a/an ( word -- article )
English natural language transformations

Prev:singularize ( word -- singular )
Next:?plural-article ( word -- article )


Vocabulary
english

Inputs
worda string


Outputs
article"a" or "an"


Word description
Gives the proper indefinite singular article (a or an) for the word. For words which begin with a vowel sound, an is used, whereas a is used for words which begin with a consonant sound.

Notes
The output does not contain the input. The output of this word is always a singular article, regardless of the plurality of the input.

Examples
USING: english kernel combinators sequences io ; "object" [ a/an ] keep " " glue print
an object


See also
?plural-article, a10n, comma-list

Definition


: a/an ( word -- article )
[ first ] [ length ] bi 1 = "afhilmnorsx" vowels ? member?
"an" "a" ? ;