pona/word

Types

pub type Word {
  Word(
    id: String,
    book: String,
    coined_era: String,
    coined_year: String,
    source_language: String,
    usage_category: String,
    translations: Dict(String, WordTranslation),
    creator: List(String),
  )
}

Constructors

  • Word(
      id: String,
      book: String,
      coined_era: String,
      coined_year: String,
      source_language: String,
      usage_category: String,
      translations: Dict(String, WordTranslation),
      creator: List(String),
    )
pub type WordError {
  JSONDecodeError(json.DecodeError)
  DynamicError(dynamic.Dynamic)
  WordNotFound(String)
  WordParsingError(String)
  TranslationNotFound(String)
}

Constructors

  • JSONDecodeError(json.DecodeError)
  • DynamicError(dynamic.Dynamic)
  • WordNotFound(String)
  • WordParsingError(String)
  • TranslationNotFound(String)
pub type WordFetcher {
  WordFetcher(word: String, lang: List(String))
}

Constructors

  • WordFetcher(word: String, lang: List(String))

Constants

pub const sona_linku: String = "https://api.linku.la/v1/words/"

Functions

pub fn fetch(wf: WordFetcher) -> Result(Word, WordError)
pub fn get_translation(
  word: Word,
  lang: String,
) -> Result(WordTranslation, WordError)
pub fn language(wf: WordFetcher, new: String) -> WordFetcher
pub fn word(word: String) -> WordFetcher
Search Document