EctoTsvector.Dictionary (ecto_tsvector v0.1.0)

Helper module for Postgres supported language dictionaries.

Summary

Functions

Returns the generic language dictionary for Postgres: "simple".

Maps a two character language code to the corresponding language dictionary in Postgres, returns the generic dictionary if the language code is not recognized.

Maps a two character language code to the corresponding language dictionary in Postgres, raises if the language code is not recognized.

Functions

generic()

@spec generic() :: String.t()

Returns the generic language dictionary for Postgres: "simple".

language_code_to_postgres(language_code)

@spec language_code_to_postgres(String.t()) :: String.t()
@spec language_code_to_postgres(String.t()) :: String.t()

Maps a two character language code to the corresponding language dictionary in Postgres, returns the generic dictionary if the language code is not recognized.

Omits language localizations, i.e. "en-US" is treated identically to "en".

language_code_to_postgres!(language_code)

Maps a two character language code to the corresponding language dictionary in Postgres, raises if the language code is not recognized.

Omits language localizations, i.e. "en-US" is treated identically to "en".