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

Request: Support thesaurus.com #31

Closed idbrii closed 5 years ago

idbrii commented 6 years ago

Great plugin!

Looks like this would help support the new thesaurus.com output format:

https://github.com/Manwholikespie/thesaurus

Not sure if you'd want to include their python module directly?

Ron89 commented 6 years ago

Yes, I have seen that plugin and was thinking the same. Will try to port it in as soon as I'm free.

Ron89 commented 6 years ago

@idbrii , sorry for the long delay. I just submitted my defense a week ago, lol. The change is now done. You will need to

  1. install requests and thebeautifulsoup4 for the python you setup to use with thesaurus query (is there a way for auto local install?).
  2. add thesaurus_com into your g:tq_enabled_backends list. I will add it in the default setting when it is confirmed to be working.
Ron89 commented 6 years ago

Hi, @idbrii , I have improved the usability of this feature and now merged it into main branch (commit 5de8051). Please try it out and give me your feedback. If you think it satisfies your need, please close this issue. Thanks.

Manwholikespie commented 6 years ago

Figured it would be easier to ask here rather than start a new issue— I saw in some of your change logs you mentioned "Fix thesaurus_com backend issue with thesaurus Python package"... was there something wrong with thesaurus? Or was something wrong with how you were prompting the user to install the backend, etc? I was just curious in the event that I needed to fix something.

Great projects by the way! I remember thinking back in HS I could make money plagiarizing things with nltk's pos_tagger and thesaurus.com. My inner demons morals kept me from doing so, but it still would've been fun.

Until our next embrace, The Fifth Bishop of Dark Lord Bettius Crocker— Robert.

Ron89 commented 6 years ago

@Manwholikespie , Hi, it's nice to see you here~ Your Python project works great. It's just that this is a first time I added Python dependency for this plugin, and I used to use ModuleNotFoundError to detect the existence of the required dependency. That caused some problem on my Mac later on (for some reason, it doesn't have ModuleNotFoundError in the ImportError). So I changed into a more Pythonic way to find out the dependency and prompt user to install it. The result is satisfying already. I'd love to be able to get rid of the dependency prompt completely with some kind of auto-install mechanism. But Vim/NeoVim disallowed the embedded Python to spawn child process. So I guess there is no where around this.

I didn't think much about moneytising it though. I guess looking at people enjoying using my software is satisfying enough for me (inner demons, haha). I do feel complicated when dealing with thesaurus.com though. I do like the quality of the thesaurus resource it has. But I don't know why it just have to act against open access... German's equivalent, Open Thesaurus https://www.openthesaurus.de/is so much more friendlier in this regard. It's great that your work exists. :)

Ron89 commented 5 years ago

After waiting for an considerable amount of time for feedback. I consider this issue to be resolved for now. If there are problems with the new feature, please raise it as a separate issue.