Lexicon v0.1.1 Lexicon
A lexicon (word list) implemented in Elixir.
Summary
Functions
Adds a word to the lexicon
Checks if prefix is in the given lexicon
Checks if word is in the given lexicon
Returns a new empty lexicon
Creates a lexicon
from an enumerable collection of words
Functions
Adds a word to the lexicon
.
Examples
iex> lexicon = Lexicon.new(["cat", "dog"])
#Lexicon<size: 2>
iex> Lexicon.add(lexicon, "elephant")
#Lexicon<size: 3>
Checks if prefix is in the given lexicon
.
Examples
iex> lexicon = Lexicon.new(["cat", "dog"])
iex> Lexicon.has_prefix?(lexicon, "ca")
true
iex> Lexicon.has_prefix?(lexicon, "cat")
true
iex> Lexicon.has_prefix?(lexicon, "ba")
false