You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be useful to be able to retrieve the synonym that was matched for a specific word.
When calling the autocomplete.search("string", max_cost=2, size=3)
We could add a boolean parameter return_synonym that would allow us to capture the synonym that matched such that we would receive a list of tuple words_and_synonyms = autocomplete.search("string", max_cost=2, size=3, return_synonym=True) words_and_synonyms [("snake","python"), ("programming language", "python"),("framework","pytorch")]
I tried to look into the code to find a way to do it, or even create a whole new autocomplete based only on the synonyms, but it won't always work as the links used are sometimes not the one created using the autocomplete with words and synonyms
The text was updated successfully, but these errors were encountered:
Hey @seperman ,
Thank you for your prompt answer.
I've looked at the code and indeed, you are creating a new Trie branch for the synonyms.
I was just wondering how complex it would be to find the synonym that was matched.
Apart from that, great job with this tool! It works like a charm.
Hello,
It would be useful to be able to retrieve the synonym that was matched for a specific word.
When calling the
autocomplete.search("string", max_cost=2, size=3)
We could add a boolean parameter
return_synonym
that would allow us to capture the synonym that matched such that we would receive a list of tuplewords_and_synonyms = autocomplete.search("string", max_cost=2, size=3, return_synonym=True)
words_and_synonyms
[("snake","python"), ("programming language", "python"),("framework","pytorch")]
I tried to look into the code to find a way to do it, or even create a whole new autocomplete based only on the synonyms, but it won't always work as the links used are sometimes not the one created using the autocomplete with words and synonyms
The text was updated successfully, but these errors were encountered: