Ron89 / thesaurus_query.vim

Multi-language Thesaurus Query and Replacement plugin for Vim/NeoVim
http://www.vim.org/scripts/script.php?script_id=5341
Apache License 2.0
220 stars 23 forks source link

No synonyms found #28

Closed elig0n closed 6 years ago

elig0n commented 6 years ago

Hello I installed the plugin on VIM. I have a working internet connection, I have all the backends in enabled_backends, all the post-installation defaults ... but when I search a for a word either by the cursor or specifically, I get No synonym found for "WORD". I've tried with several correct english words.

I've installed the plugin via Vundle. I'm using Bash on Ubuntu (WSL).

Ron89 commented 6 years ago

Hi @elig0n , I have repeated your symptom. It seems thesaurus.com has changed their page layout again. While I make the change to comply their change, please use "datamuse_com" or any of the local thesaurus source.

let tq_enabled_backends=["thesaurus_com", "openoffice_en", "datamuse_com", "mthesaur_txt"]

Of course, local thesaurus source work only if you have the database downloaded in your file system. "datamuse_com" is an alternative online thesaurus source, and it is still working fine.

elig0n commented 6 years ago

I have tried that and also :

:let tq_enabled_backends=["datamuse_com"] :Thesaurus word No synonym found for "word".

Ron89 commented 6 years ago

This is strange...

:echo tq_enabled_backends
['datamuse_com']

<leader>cs on word
In line: ...     word ...                                                                   
Candidates for word, found by backend: datamuse_com
Synonyms: (0)articulate (1)intelligence (2)phrase (3)news (4)bible (5)discussion (6)son
          (7)parole (8)formulate (9)logos (10)scripture (11)tidings (12)watchword
          (13)countersign (14)password (15)word of god (16)give-and-take (17)holy writ
          (18)good book (19)holy scripture (20)word of honor
Type number and <Enter> (empty cancels; 'n': use next backend; 'p' use previous backend):

#----------------------------------------
:echo tq_enabled_backends
['datamuse_com']

:Thesaurus word
In line: ...     word ...                                                                   
Candidates for word, found by backend: datamuse_com
Synonyms: (0)articulate (1)intelligence (2)phrase (3)news (4)bible (5)discussion (6)son
          (7)parole (8)formulate (9)logos (10)scripture (11)tidings (12)watchword
          (13)countersign (14)password (15)word of god (16)give-and-take (17)holy writ
          (18)good book (19)holy scripture (20)word of honor
Ron89 commented 6 years ago

From the backend, the pluggin is wrapping the API provided by datamuse_com. Could you see if the result from calling following API curl http://api.datamuse.com/words\?rel_syn\=word\&max\=50 is the following json content?

[{"word":"articulate","score":3040},{"word":"intelligence","score":2770},{"word":"phrase","score":2221},{"word":"news","score":1897},{"word":"bible","score":1430},{"word":"discussion","score":1365},{"word":"son","score":1260},{"word":"parole","score":1074},{"word":"formulate","score":1015},{"word":"logos","score":773},{"word":"scripture","score":660},{"word":"tidings","score":601},{"word":"watchword","score":513},{"word":"countersign","score":407},{"word":"password","score":399},{"word":"word of god","score":159},{"word":"give-and-take","score":122},{"word":"holy writ","score":90},{"word":"good book","score":74},{"word":"holy scripture","score":43},{"word":"word of honor","score":33}]
elig0n commented 6 years ago

Yes, with some values differing.

elig0n commented 6 years ago

I do get this when I try to echo tq_enabled_backends : E121: Undefined variable: tq_enabled_buffers E15: Invalid expression: tq_enabled_buffers

and through autocompletion I see that I only have tq_map_keys & tq_use_vim_autocomplete

Ron89 commented 6 years ago

It looks like your instance of plugin was not loaded properly... Note that this plugin is an autoload plugin. Most of the variables and functions are loaded only upon your first use in the session.

You might want to troubleshoot your rc file to see if there are behaviour altering code with global effect.

Ron89 commented 6 years ago

Sorry I couldn't spare too much time addressing the thesaurus.com issue these days. I have reactivated datamuse.com as part of the default active backends. It should make this plugin functional for basic use. I will continue leave this issue open until I have the time, or someone contributed a parser for new thesaurus.com html parser.

Ron89 commented 6 years ago

Can I take that this issue is addressed and can close?

elig0n commented 6 years ago

Alright, thanks