package iso639

  1. Overview
  2. Docs
Language Codes for OCaml

Install

Dune Dependency

Authors

Maintainers

Sources

iso639-v0.0.4.tbz
sha256=fd849d157b104ab3484f0b848ffd2fe1174ffa6451120f2271dc474c946c0dc3
md5=79a0cdea5f5d9e000af8e3e2b4b201e8

Description

This library implements a type to identify languages and macrolanguages from ISO 639-3 and language groups from ISO 639-5, and provides conversions to and from two- and three-letter codes defined by these and other parts of ISO 639.

Published: 25 Mar 2019

README

Identification of Languages and Language Groups for OCaml

Synopsis

This library defines abstract types for languages and language families covered by ISO 639 and provides related functionality and conversions.

  • Lang.t maps one-to-one to ISO 639-3 language codes, which covers individual languages and macrolanguages.

  • Lang_family.t maps one-to-one to ISO 639-5 language codes, which covers language families and groups.

  • Lang_or_family.t is the sum of the two above types.

Example

# #require "iso639";;
# open Iso639;;
# #install_printer Lang.pp;;

# let por = Lang.of_string_exn "por";;
val por : Lang.t = por
# Lang.to_iso639p1 por;;
- : string option = Some "pt"
# Lang.macrolanguage por;;
- : Lang.t option = None
# Lang.macrolanguage_members por;;
- : Lang.t list = []

# let nor = Lang.of_string_exn "nor";;
val nor : Lang.t = nor
# Lang.macrolanguage_members nor;;
- : Lang.t list = [nob; nno]
# Lang.macrolanguage (Lang.of_string_exn "nob");;
- : Lang.t option = Some nor

Limitations

Only part of ISO 639 which are expected to be commonly used by applications are implemented.

The library does not include the English end French names of languages, and there is no plan to add them, as this would significantly increase the size of the library.

Dependencies (2)

  1. dune >= "1.1"
  2. ocaml >= "4.04.2"

Dev Dependencies

None

Used by (1)

  1. confero

Conflicts

None

OCaml

Innovation. Community. Security.