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

Add french backend with synonymo.fr #43

Closed perelo closed 5 years ago

perelo commented 5 years ago

Hi,

Great plugin! Missing French support for me :)

I used BeautifulSoup to parse the html of synonymo.fr. I also made a version with only html.parser here based on what was done in woxikon_de_lookup.py. But the result is much longer and less readable. Let me know if you feel that BeautifulSoup dependency seems cumbersome.

Ron89 commented 5 years ago

Hi @perelo , since you are using Master to create the PR, and your change on the thesaurus_query.py broke some rendering for ThesaurusQueryLookupCurrentWord feature. So I only cherry picked your addition on the french backend and the ReadMe file.

For the backend itself, I don't think using bs4 as dependency has any issue. I used to add third party dependency for thesaurus_query.com support as well. However, doing so shall require failure handling. So that when import bs4 fails, not-so-power user can still use the prompt to understand what went wrong. I added the fail handling and the option to disable the backend in session when the dependency fails.

Ron89 commented 5 years ago

I have sent you the PR for the change needed for bs4. Please review. Once it is finished, please use a branch that do not contain thesaurus_query.py change to submit PR again.

perelo commented 5 years ago

Hi, Damn, I was dumb, didn't thought I would add more commits to master, which are more personal, the PR is ruined...

You're right we should add failure handling for bs4, I merged your PR on my fork, thanks.

There is small inconsistent docs at the moment, I added two french backends : synonymo_fr and cnrtl_fr, but synonymo is still present in cntrl_fr_lookup.py. I'll make another proper PR with both backends, error handling and and proper docs :)