Text (Text v0.2.0) View Source
Functions for basic text processing and analysis.
Link to this section Summary
Types
A corpus module
A tuple of the form {language, number}
A language as a BCP-47 string
A vocabulary module
Functions
Pluralize a noun.
Link to this section Types
Link to this section Functions
See Text.Ngram.ngram/2
.
Pluralize a noun.
Arguments
word
is any English noun.options
is a keyword list of options.
Options
:mode
is either:modern
or:classical
. The default is:modern
.:language
is the inflection module to be used. The default and ony option isText.Inflect.En
Returns
- a
String
representing the pluralized noun
Notes
mode
when :classical
applies pluralization
on latin nouns used in english but with latin
suffixes.
Examples
iex> Text.pluralize_noun "Major general"
"Major generals"
iex> Text.pluralize_noun "fish"
"fish"
iex> Text.pluralize_noun "soliloquy"
"soliloquies"
iex> Text.pluralize_noun "genius", mode: :classical
"genii"
iex> Text.pluralize_noun "genius"
"geniuses"
iex> Text.pluralize_noun "platypus", mode: :classical
"platypodes"
iex> Text.pluralize_noun "platypus"
"platypuses"