Give me a word, and I'll tell you if it's a or an before it.
Usage:
$ ./aoran university
Hey, I need to download a copy of CMUdict (~3.5mb), can I? (Y/n)
Downloading...
Downloaded! Thanks for waiting.
a university
$ ./aoran UMBRELLA
an umbrella
$ ./aoran dfgertwesdf
Sorry, I couldn't find this word :(
English grammar has a special rule for when to use a or an before a word, based on the first sound of it. This may confuse people using English as a second language (like myself).
This tool uses CMUdict in order to solve this issue. Give it a word and it will lookup the first sound of it and tell you if it's a vowel sound or not.
It's really easy. Just clone the repo and start calling it like the examples.
The auxiliary shell script assumes python3
exists on your system. If not, you can call the python file directly, example:
$ python aoran.py table
a table
You can also use this as a library:
import aoran
article = aoran.resolve_article_for('word')
print(article)