Crates.io | codes-iso-639 |
lib.rs | codes-iso-639 |
version | 0.1.5 |
source | src |
created_at | 2022-12-07 00:41:00.644664 |
updated_at | 2022-12-25 02:49:28.232973 |
description | This package contains an implementation of the ISO 639 (Parts 1, 3, and 5) Language Code specifications. |
homepage | |
repository | https://github.com/johnstonskj/rust-codes |
max_upload_size | |
id | 731492 |
size | 518,716 |
This package contains an implementation of the ISO 639 part 1, part 3, and part 5 Language Code specifications.
ISO 639-1, the two-character code, was devised primarily for use in terminology and includes identifiers for most of the major languages of the world that are not only most frequently represented in the total body of the world's literature, but that are also among the most developed languages of the world, having specialized vocabulary and terminology. ISO 639-1 includes identifiers for a subset of the languages covered by ISO 639-2.
ISO 639-2, the three-character code, was devised primarily for use in bibliography, as well as in terminology. It has a less restrictive scope than ISO 639-1, being devised to include identifiers for languages that are most frequently represented in the total body of the world's literature, regardless of whether specialized terminologies exist in those languages or not. Because three characters allow for a much larger set of distinct identifiers, an alpha-3 code can accommodate a much larger set of languages. Indeed, ISO 639-2 does include significantly more entries than ISO 639-1, yet the scope is not so broad as to result in a separate identifier for every individual language that has been documented. ISO 639-2 limits coverage of individual languages to those for which at least modest bodies of literature have been developed. Other languages are still accommodated, however, by means of identifiers for collections of languages, such as language families.
In summary, the basic difference between ISO 639-1 and ISO 639-2 has to do with scope: the scope of ISO 639-1 is more restrictive, focusing on languages for which specialized terminologies have been developed. In practical terms, ISO 639-2 covers a larger number of individual languages (due to its less-restrictive scope). It also includes identifiers for collections of languages.
For notes on the design of the API, see the repository README.
use codes_iso_639::part_1::LanguageCode;
let code = LanguageCode::Fr;
assert_eq!(code.as_ref(), "fr");
assert_eq!(code.language_name(), "French");
By default only the serde
feature is enabled, and part-1 two-letter
language codes.
serde
- Enables serialization of the different Language Code types.part_3
- Adds the ISO 639-3 three-letter language codes.
comment
- Adds the LanguageCode::comment
method.language_type
- Adds the LanguageCode::language_type
method.macro_individuals
- Adds the LanguageCode::macro_individuals
method.scope
- Adds the LanguageCode::scope
method.part_5
- Adds the ISO 639-5 three-letter language family or group codes.Version 0.1.5
build
module in codes-commonVersion 0.1.4
Standardized
and FixedLengthCode
traits.Version 0.1.3
codes-common
CSV handling framework.Version 0.1.2
ALL_CODES
constant.Version 0.1.1
codes-common
Code
trait and macro-created implementation.Version 0.1.0
TBD