English-Specific

Summary
Language-specific String functions
returns the plural of a given string, based on a given count.
returns the word “an” or “a” for a given following word

Language

Jel. String

Language-specific String functions

Summary
returns the plural of a given string, based on a given count.
returns the word “an” or “a” for a given following word

Functions

plural

Jel.String.plural = function(str,
count)

returns the plural of a given string, based on a given count.  Observes a lot of the specific pluralisation rules in the English language (that is, not always just adding an s to the end of a word).

Arguments

strString, the word to pluralise if count != 1
countInteger, affects whether the string is pluralised or not (not pluralised if this equals 1)

Example

Jel.String.plural("car", 2); // "cars"
Jel.String.plural("fly", 1); // "fly"
Jel.String.plural("fly", 2); // "flies"

an

Jel.String.an = function(str)

returns the word “an” or “a” for a given following word

Arguments

strString, the word to check

Example

Jel.String.an("apple"); // "an"
Jel.String.an("car"); // "a"
Jel.String.plural = function(str,
count)
returns the plural of a given string, based on a given count.
Jel.String.an = function(str)
returns the word “an” or “a” for a given following word