pluralize icon indicating copy to clipboard operation
pluralize copied to clipboard

Similar library but for articles

Open avin-kavish opened this issue 3 years ago • 4 comments

Is there a similar library for chosing between a and an given a word?

avin-kavish avatar Jun 26 '22 08:06 avin-kavish

@avin-kavish I think you can create your own. you have check if the first letter of a value passed starts with a vowel. but there are possibilites that a value starts a vowel but uses an "a" article.

eg. a university

and you should store them in a "library".

like what the author did to irregular rules and uncountable rules.

ronssij avatar Jul 06 '22 02:07 ronssij

I know. I'm looking for a maintained library, or one I can fork. Do you have an (ideally exhaustive) reference of those exceptional cases?

avin-kavish avatar Jul 06 '22 02:07 avin-kavish

Might be worth starting with something like https://www.npmjs.com/package/@informath/text-to-ipa and then checking to see if the first sound is a vowel sound or not? Just noting that this is dialect specific, e.g. "an herb" (American English) vs "a herb" (Australian English) so it's not something you can derive from the written text alone.

matthewberryman avatar Jul 15 '22 05:07 matthewberryman

@avin-kavish Check out this library: https://www.npmjs.com/package/indefinite

kennydifiore avatar Aug 30 '22 17:08 kennydifiore