An offline-first dictionary using WordNet -or- OpenAI
I'm sick of online dictionaries. Most of them display lots of ads which is distracting, and almost none of them let you save the words to review them in the future and memorzie them, unless, well, you pay for a premium package.
So, here's an offline dictionary that uses WordNet to display the definition and the examples of a word. It saves your searched words in a list so you can check them later in your spare time.
Now Telesm also supports calling OpenAI api to get the definition and examples of the word. See Usage for more details.
Telesm is the Persian word for Talisman.
Using pip
:
pip install telesm
Or if you want to have it globally:
pipx install telesm
telesm <word>
# Example output:
talisman:
‣ a trinket or piece of jewelry usually hung about the neck and thought to be a magical protection against evil or disease
This will save the word to the database by default, if you don't want to save the word pass --no-save
argument.
telesm <word> --no-save
telesm --list
If you want to navigate over the words one by one, pass --navigate
argument:
telesm --list --navigate
telesm --random
# Example output:
accruing:
‣ grow by addition
Examples:
⁃ The interest accrues
telesm --search tal
# Example output:
talisman:
‣ a trinket or piece of jewelry usually hung about the neck and thought to be a magical protection against evil or disease
telesm --delete <word>
To use AI feature you need to specify your OpenAI api key in ~/.telesm.conf
file.
-
Create
~/.telesm.conf
file, if you haven't already. -
Acquire your api key from OpenAi Dashboard.
-
Put your api key in the config file:
OPENAI_API_KEY="<your-api-key>"
Now you can use the AI feature:
telesm --ai <word>
You can set AI_FIRST=1
to ~/.telesm.conf
file to use AI without the need to pass --ai
argument:
telesm <word> # Would use AI now
This will also save the word in the database so you'd have it offline for future uses. Pass --no-save
if you don't want to save it.
If you already searched for a word without using AI and saved the word in the database, passing --ai
would not have any effects. Try deleting the word by running telesm --delete <word>
and try again in case you prefer to have the AI definition instead.