cambridge
cambridge copied to clipboard
Fail in case of word not found
Current in case the word is not found, cambridge asks the user to select a similar word that is present in the dictionary.
I'm basic building a GUI around cambridge, and I need it to fail and return exit code != 0 in case the word is not found, without asking the user.
Otherwise my GUI will hang waiting for cambridge to exit.
Hi. Actually I didn't intend this project to be used as a library since its data is scraped.
However, I still added a new parameter no_suggestions
to the functions search_webster
and search_cambridge
for your convenience. If you don't want spell suggestions, just pass these two functions with no_suggestions
as True
(False
by default). If not found with no_suggestions
as True
, '-1' will be returned. You can update the package to v3.6.2 to use them.
def search_webster(con, cur, input_word, is_fresh=False, no_suggestions=False)
def search_cambridge(con, cur, input_word, is_fresh=False, is_ch=False, no_suggestions=False)
P.S. PLEASE don't use this project for monetary gains because we are not sure if there is legal risks of using scraped data for that purpose. Thank you.