Module Iso639.Lang
Individual languages and macrolanguages as identified by ISO 639-3.
ISO 639-3 defines language codes for individual languages and macrolanguages. This module defines an abstract denotaion of these language codes. It provides partial conversions to and from language codes of ISO 639-1 and ISO 639-2, and one-to-one conversions to and from language codes of ISO 639-3.
ISO 639-1 and 639-2 contains a subset of ISO 639-3 along with a subset of ISO 639-5, so the correspondence is partial in both directions.
Basic Operations
val pp : Stdlib.Format.formatter -> t -> unitpp ppf langprints the ISO 639-3 language code oflangonppf.
val scope : t -> [> `Individual | `Macro | `Special ]scope langis`Individualiflangis an individual language`Macroiflangis a macrolanguage, or`Specialiflangis not a language.
Conversions
val to_int : t -> intAn injective mapping to 16 bit integers.
val of_int_exn : int -> tThe partial inverse of
to_int.- raises Invalid_argument
if the argument is out of range.
val to_lang_or_family : t -> Lang_or_family.tInjection into the combined ISO 639 type.
val of_lang_or_family : Lang_or_family.t -> t optionRestriction from the combined ISO 639 type.
Language Code Conversions
val to_string : t -> stringto_string langis the ISO 639-3 language code oflang.
val of_string : string -> t optionof_string sis the language represented by the ISO 639-3 language codes.
val of_string_exn : string -> tof_string_exn sis the language represented by the ISO 639-3 language codes.
val is_iso639p1 : t -> boolis_iso639p1 langis true ifflangis represented in ISO 639-1.
val to_iso639p1 : t -> string optionto_iso639p1 langis the ISO 693-1 language code oflang, if it exists.
val of_iso639p1 : string -> t optionof_iso639p1 sis the language represented by the ISO 639-1 language codes.
val is_iso639p2 : t -> boolis_iso639p2 langis true ifflangis represented in ISO 639-2.
val to_iso639p2t : t -> string optionto_iso639p2t langis the ISO 639-2T language code oflang, if it exists.
val to_iso639p2b : t -> string optionto_iso639p2b langis the ISO 639-2B language code oflang, if it exists.
val of_iso639p2 : string -> t optionof_iso639p2 sis the language represented by the ISO 639 part 2T or 2B language codes.