package iso639

  1. Overview
  2. Docs

Module Iso639.Lang_familySource

Language families and groups as identified by ISO 639-5.

ISO 639-5 defines language codes for selected language groups and families. A few of these are also present in ISO 639-1 and 639-2. This module defines an abstract type covering these language families and groups, and provides conversions to the relevant language codes.

Remainder groups of ISO 639-2 are not distinguished from the corresponding complete groups of ISO 639-5.

Sourcetype t

A representation of language families and groups in ISO 639-5.

Basic Operations

Sourceval equal : t -> t -> bool

Equality of the corresponding ISO 693-5 language codes.

Sourceval compare : t -> t -> int

Lexicographic order of the corresponding ISO 639-5 language codes.

Sourceval pp : Format.formatter -> t -> unit

pp ppf lang prints the ISO 639-5 language code of lang on ppf.

Conversions

Sourceval to_int : t -> int

An injective mapping to 16 bit integers.

Sourceval of_int : int -> t option

The partial inverse of to_int.

Sourceval of_int_exn : int -> t

The partial inverse of to_int.

Sourceval to_lang_or_family : t -> Lang_or_family.t

Injection into the combined ISO 639 type.

Sourceval of_lang_or_family : Lang_or_family.t -> t option

Restriction from the combined ISO 639 type.

Language Code Conversions

Sourceval to_string : t -> string

to_string s is the ISO 639-5 language code of lang.

Sourceval of_string : string -> t option

of_string s is the language family or group represented by the ISO 639-5 code s.

Sourceval of_string_exn : string -> t

of_string_exn s is the language family or group represented by the ISO 639-5 code s.

Sourceval is_iso639p1 : t -> bool

is_iso639p1 lang is true iff lang is represented in ISO 639-1.

Sourceval to_iso639p1 : t -> string option

to_iso639p1 lang is the ISO 693-1 language code of lang, if it exists.

Sourceval of_iso639p1 : string -> t option

of_iso639p1 s is the language represented by the ISO 639-1 language code s.

Sourceval is_iso639p2 : t -> bool

is_iso639p2 lang is true iff lang is represented in ISO 639-2.

Sourceval to_iso639p2t : t -> string option

to_iso639p2t lang is the ISO 639-2T language code of lang, if it exists.

Sourceval to_iso639p2b : t -> string option

to_iso639p2b lang is the ISO 639-2B language code of lang, if it exists.

Sourceval of_iso639p2 : string -> t option

of_iso639p2 s is the language represented by the ISO 639 part 2T or 2B language code s.

OCaml

Innovation. Community. Security.