Talk Like A (x) v0.0.7 TalkLikeAX View Source

TalkLikeAX provides you the ability convert a string of text into a different lingo (AKA language).

Link to this section Summary

Functions

Returns a tuple with the string translated to default lingo pirate.

Returns a tuple with the string transalated to your desired lingo.

Returns a tuple with the string transalated to your desired lingo.

Link to this section Functions

Returns a tuple with the string translated to default lingo pirate.

Parameters

  • words: String of the words you would like tranlsated to a lingo

Examples

iex> TalkLikeAX.translate("hello friend")
{ :ok, "ahoy matey" }

iex> TalkLikeAX.translate("")
{ :ok, "" }
Link to this function

translate(words, lingo \\ :pirate)

View Source

Returns a tuple with the string transalated to your desired lingo.

Parameters

  • words: String of the words you would like tranlsated to a lingo
  • lingo: Atom for lingo you would like to translate to. :pirate is the only language with a robust dictionary of words.

Examples

iex> TalkLikeAX.translate("hello friend", :pirate)
{ :ok, "ahoy matey" }


iex> TalkLikeAX.translate("Hello friend, doctorargus", :doesnt_exist)
{ :error, :lingo_doesnt_exist }
Link to this function

translate(words, lingo, extended_lingo)

View Source

Returns a tuple with the string transalated to your desired lingo.

Parameters

  • words: String of the words you would like tranlsated to a lingo
  • lingo: Atom for lingo you would like to translate to. :pirate is the only language with a robust dictionary of words.
  • extended_lingo: A map containing two properties "words" & "gerunds" to add additional custom words to use in the translation. Both "words" & "gerunds" must be a map of "word" => "translated_word"

Examples

iex> TalkLikeAX.translate("Hello friend, doctorargus", :pirate, %{ "words" => %{ "doctorargus" => "Doc Arrrrgus" } })
{ :ok, "Ahoy matey, Doc Arrrrgus" }