Programmatically determine whether to describe an object with “a” or “an”?

后端 未结 8 1530
耶瑟儿~
耶瑟儿~ 2020-12-01 21:13

I have a database of nouns (ex \"house\", \"exclamation point\", \"apple\") that I need to output and describe in my application. It\'s hard to put together a natural-soundi

8条回答
  •  春和景丽
    2020-12-01 21:45

    Make an array with vowels in it. Check if the first letter of the word you are checking is in the vowel array. Will work except when dealing with acronyms.

提交回复
热议问题