codes_iso_639/part_3.rs
1/*!
2This module provides an implementation of ISO 639-3, Codes for the
3representation of names of languages — Part 3: Alpha-3 code for comprehensive
4coverage of languages.
5 */
6
7#[cfg(feature = "serde")]
8use serde::{Deserialize, Serialize};
9
10// ------------------------------------------------------------------------------------------------
11// Public Types
12// ------------------------------------------------------------------------------------------------
13
14///
15/// A language identifier (also known as a language code or language code
16/// element) represents one or more language names, all of which designate the
17/// same specific language. The ultimate objects of identification are
18/// languages themselves; language names are the formal means by which the
19/// languages denoted by language identifiers are designated.
20///
21///Languages are not static objects; there is variation temporally, spacially,
22/// and socially; every language corresponds to some range of variation in
23/// linguistic expression. In this part of ISO 639, then, a language
24/// identifier denotes some range of language varieties. The scope of
25/// languages in Part 3 of ISO 639 is either individual language or
26/// macrolanguage. Parts 2 and 5 of ISO 639 also contain codes whose scope is
27/// collection of languages.
28///
29#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
30#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
31pub enum LanguageScope {
32 /// Individual languages
33 ///
34 /// In Part 3 of ISO 639, most identifiers are assumed to denote distinct
35 /// individual languages. Furthermore, it is a goal for this part of ISO
36 /// 639 to provide an identifier for every distinct human language that
37 /// has been documented, whether living, extinct, or constructed, and
38 /// whether its modality is spoken, written or signed.
39 ///
40 Individual,
41 /// Macrolanguages
42 ///
43 /// Other parts of ISO 639 have included identifiers designated as
44 /// individual language identifiers that correspond in a one-to-many
45 /// manner with individual language identifiers in this part of ISO 639.
46 /// For instance, this part of ISO 639 contains over 30 identifiers
47 /// designated as individual language identifiers for distinct varieties
48 /// of Arabic, while ISO 639-1 and ISO 639-2 each contain only one
49 /// identifier for Arabic, "ar" and "ara" respectively, which are
50 /// designated as individual language identifiers in those parts of ISO
51 /// 639. It is assumed here that the single identifiers for Arabic in
52 /// parts 1 and 2 of ISO 639 correspond to the many identifiers
53 /// collectively for distinct varieties of Arabic in part 3 of ISO 639.
54 ///
55 Macro,
56 /// Collections of languages
57 ///
58 /// A collective language code element is an identifier that represents a
59 /// group of individual languages that are not deemed to be one language
60 /// in any usage context. Whereas ISO 639-2 includes three-letter
61 /// identifiers for such collections of languages, this part of ISO 639
62 /// provides identifiers for individual languages and macrolanguages only.
63 ///
64 Collection,
65 /// Dialects
66 ///
67 /// The linguistic varieties denoted by each of the identifiers in this
68 /// part of ISO 639 are assumed to be distinct languages and not dialects
69 /// of other languages, even though for some purposes some users may
70 /// consider a variety listed in this part of ISO 639 to be a "dialect"
71 /// rather than a "language". In this standard, the term dialect is used
72 /// as in the field of linguistics where it simply identifies any
73 /// sub-variety of a language such as might be based on geographic region,
74 /// age, gender, social class, time period, or the like. This contrasts
75 /// with a popular usage in which "dialect" is typically construed to
76 /// connote a substandard or undeveloped form of language.
77 ///
78 ///The dialects of a language are included within the denotation
79 /// represented by the identifier for that language. Thus, each language
80 /// identifier represents the complete range of all the spoken or written
81 /// varieties of that language, including any standardized form.
82 ///
83 ///
84 Dialect,
85 /// Reserved for local use
86 ///
87 /// Identifiers `qaa` through `qtz` are reserved for local use, to be used
88 /// in cases in which there is no suitable existing code in ISO 639. There
89 /// are no constraints as to scope of denotation. These identifiers may
90 /// only be used locally, and may not be used for interchange of data
91 /// without a private agreement.
92 ///
93 Reserved,
94 /// Special code elements
95 ///
96 /// ISO 639-2 defines three code elements for other special situations.
97 /// The identifier `mul` (multiple languages) should be applied when many
98 /// languages are used and it is not practical to specify all the
99 /// appropriate language codes. The identifier `und` (undetermined) is
100 /// provided for those situations in which a language or languages must be
101 /// indicated but the language cannot be identified. The identifier `zxx`
102 /// (no linguistic content) may be applied in a situation in which a
103 /// language identifier is required by system definition, but the item
104 /// being described does not actually contain linguistic content.
105 ///
106 Special,
107}
108
109///
110/// The five language types defined in ISO 639-3 for individual languages.
111///
112#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
113#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
114pub enum LanguageType {
115 /// Living languages
116 ///
117 /// A language is listed as living when there are people still living who
118 /// learned it as a first language. This part of ISO 639 also includes
119 /// identifiers for languages that are no longer living.
120 Living,
121 /// Extinct languages
122 ///
123 /// A language is listed as extinct if it has gone extinct in recent
124 /// times. (e.g. in the last few centuries). The criteria for identifying
125 /// distinct languages in these case are based on intelligibility (as
126 /// defined for individual languages).
127 Extinct,
128 /// Ancient languages
129 ///
130 /// A language is listed as ancient if it went extinct in ancient times
131 /// (e.g. more than a millennium ago). Identifiers are assigned to ancient
132 /// languages which have a distinct literature and are treated distinctly
133 /// by the scholarly community. It would be ideal to be able to assign
134 /// identifiers to ancient languages on the basis of intelligibility, but
135 /// ancient records rarely contain enough information to make this
136 /// possible. In order to qualify for inclusion in ISO 639-3, the language
137 /// must have an attested literature or be well-documented as a language
138 /// known to have been spoken by some particular community at some point
139 /// in history; it may not be a reconstructed language inferred from
140 /// historical-comparative analysis.
141 ///
142 Ancient,
143 /// Historic languages
144 ///
145 /// A language is listed as historic when it is considered to be distinct
146 /// from any modern languages that are descended from it: for instance,
147 /// Old English and Middle English. In these cases, the language did not
148 /// become extinct; rather, it changed into a different language over
149 /// time. Here, too, the criterion is that the language have a literature
150 /// that is treated distinctly by the scholarly community.
151 ///
152 Historic,
153 /// Constructed languages
154 ///
155 /// This part of ISO 639 also includes identifiers that denote constructed
156 /// (or artificial) languages. In order to qualify for inclusion the
157 /// language must have a literature and it must be designed for the
158 /// purpose of human communication. It must be a complete language, and be
159 /// in use for human communication by some community long enough to be
160 /// passed to a second generation of users. Specifically excluded are
161 /// reconstructed languages and computer programming languages.
162 Constructed,
163 /// Special and Reserved
164 ///
165 /// Four codes are set aside in ISO 639-2 and ISO 639-3 for cases where
166 /// none of the specific codes are appropriate. These are intended
167 /// primarily for applications like databases where an ISO code is
168 /// required regardless of whether one exists.
169 ///
170 /// In addition, 520 codes in the range qaa–qtz are 'reserved for local
171 /// use'.
172 Special,
173}
174
175// ------------------------------------------------------------------------------------------------
176//
177// The rest of this file is generated by the package build script.
178//
179// ------------------------------------------------------------------------------------------------
180
181include!(concat!(env!("OUT_DIR"), "/part_3.rs"));