created by |
Chong HE |
|
script type |
utility |
|
description |
`thesaurus_query.vim` is a plugin for user to lookup synonyms of any word
under cursor or phrase covered in visual mode, and replace it with an user
chosen synonym. It also accepts word/phrases from manual input for synonym
checkup. This plugin has multiple backends, currently support English,
Chinese (if so configured), German (if so configured) and Russian(if so
configured) thesaurus query.
This plugin is written in Python, hence it requires Vim built with either
+Python or +Python3 or both. You may check it by using Vim command
:echo has('python')+has('python3')
If returned value is larger than `0`, This plugin will be functional.
Screencast: http://i.imgur.com/3QXxUp7.gif
This plugin is also hosted on github:
https://github.com/Ron89/thesaurus_query.vim
If you meet any problem while using, please come to my github page and report
the issue, thanks~
## How to Use
1. Most commonly used: under normal mode, `<Leader>cs` will query the word
under cursor and attempt to replace the word with user chosen candidate.
screenshot: http://i.imgur.com/LJpdBwD.png
2. Under visual mode, same key-binding will query the word under cursor and
attempt to replace the word with user chosen candidate.
3. You may also query any word by using the command
:Thesaurus <your_word>
result will be displayed in split buffer.(feature inherited from Anton's
Online Thesaurus plugin)
screenshot: http://i.imgur.com/3B1i8Di.png
4. You can also use `ctrl-x ctrl-u` insertmode autocomplete function for
synonym query.
## Multi-language query support and Russian Thesaurus backend.
Multi-language Thesaurus Query feature is added since Version 0.3.0.
Currently English, German and Russian are supported. By default, only English
backends are activated. Users may activate Russian Thesaurus backends by
```
let g:tq_language = 'ru'
```
or activate all English, German and Russian backends by
```
let g:tq_language = ['de', 'ru', 'en']
```
For detail, please refer to my [Documentation](https://github.com/Ron89/thesaurus_query.vim/blob/master/doc/thesaurus_query.txt).
## About Its Backends:
Another feature of this plugin is that under the hood, the plugin uses multiple
backends sequentially to query for a synonym. To successfully query a synonym,
at least one of the three backends need to function properly.
* `thesaurus_com`: queries from `http://thesaurus.com/` for
synonym, so internet connection is required for this backend's functionality.
The returned synonym list from this source has very high quality. But since
`thesaurus.com` didn't actually provide official API. The functionality of
this backend might fail when the website changes its design.
* `datamuse_com` queries from `http://www.datamuse.com` using its officially
provided API. The returned synonym list is usually quite relavant with
reasonable quality. But the synonyms list tend to be short, so it might leave
out some less-frequently-used synonyms.
* `mthesaur_txt` queries from local `mthesaur.txt`. It is an useful option when
you don't have any internet access at all. For this backend to work, be sure
to download the file from `http://www.gutenberg.org/files/3202/files/` and
place it under "~/.vim/thesaurus". If you place the file elsewhere, change
global variable |g:thesaurus_query#mthesaur_file| to point to the file you
downloaded, eg. put the following line `let
g:tq_mthesaur_file="~/.config/nvim/thesaurus/mthesaur.txt"` into
your `.vimrc` file if your `mthesaur.txt` is placed in folder
"~/.config/nvim/thesaurus/".
* `cilin_txt` queries from local `cilin.txt`. It makes use of a Chinese
thesaurus source "cilin.txt". For this backend to
work, be sure to download the file from
`https://github.com/shijiebei2009/Algorithms/blob/master/src/main/resources/cilin.txt`
and place it under "~/.vim/thesaurus". If you place the file elsewhere,
change global variable |g:tq_cilin_txt_file| to point to the file you
downloaded, eg. put the following line `let
g:tq_cilin_txt_file="~/.config/nvim/thesaurus/cilin.txt"` into your `.vimrc`
file if your `cilin.txt` is placed in folder "~/.config/nvim/thesaurus/".
Note that if you downloaded "cilin.txt" from elsewhere, make sure that your
source `cilin.txt` is utf-8 encoded. Or the plugin won't function correctly
with the file.
* `yarn_synsets` is a Russian thesaurus backend. It uses
[yarn-synsets.csv](http://russianword.net/yarn-synsets.csv) as synonym
resource, providing a fast responding and decent thesaurus query solution.
Please place `yarn-synsets.csv` in `~/.vim/thesaurus`, or use variable
`g:tq_yarn_synsets_file` to indicate the location of `yarn-synsets.csv` in
your system.
* `jeck_ru` is a Russian thesaurus backend. It queries
[jeck.ru](http://jeck.ru/tools/SynonymsDictionary) for synonym resources.
This website didn't provide standard API to use. Hence functionality of this
backend depends on whether the website owner will change the webpage design.
* `woxikon_de` is a German thesaurus backend. It queries
[woxikon.de](http://synonyme.woxikon.de/synonyme) for synonym resources. This
website didn't provide standard API to use. Hence functionality of this
backend depends on whether the website owner will change the webpage design.
## Requirement
* Tested to be working on vim 7.3 or newer.
* The plugin is written in python, `+python` support version of Vim is
required.
* At least one of the below requirements need to be met:
+ For online query backends to work, Internet connection is required;
+ For `mthesaur_txt` backend to work, `mthesaur.txt` is required.
## Credit:
This plugin is functionally based on and extended from the ideas behind
vim-online-thesaurus by Anton Beloglazov:
http://www.vim.org/scripts/script.php?script_id=4588.
Several key improvements were made comparing to his plugin:
- added synonym replacing mechanism
- added fallback backend to ensure functionality even when server down or lack
of internet connection.
- added multilanguage support. With proper backends, it is possible to extend
the functionality of this plugin to any western letter based languages.
|
|
install details |
## Manual Install
1. Untar the package, using `tar -xf [downloaded-package-name]` or otherwise.
2. Go into the extracted folder.
* For Vim users, copy the folder `plugin`, `autoload`, `syntax` and `doc`
into your `~/.vim` folder;
* For NeoVim users, copy the folder `plugin` `autoload` `syntax` and `doc`
into your `~/.config/nvim` folder.
The software you use should recognize the plugin files correctly.
## Using Package Manager
For the ease of organizing and future update, the using of package manager is
recommended. Here is an installation instruction for some of the most popular
package managers.
* Pathogen
git clone https://github.com/ron89/thesaurus_query.vim ~/.vim/bundle/thesaurus_query.vim
* Vundle
Add to .vimrc:
Bundle 'ron89/thesaurus_query.vim'
Run
:BundleInstall
* NeoBundle
Add to .vimrc:
NeoBundle 'ron89/thesaurus_query.vim'
Run
:NeoBundleInstall
* vim-plug
Add to .vimrc:
Plug 'ron89/thesaurus_query.vim'
Run
:PlugInstall
## If you are using Arch flavor linux. You may also install the plugin from AUR:
https://aur.archlinux.org/packages/vim-thesaurus_query/
https://aur.archlinux.org/packages/nvim-thesaurus_query/ |
|
Click on the package to download.
thesaurus_query.vim-0.7.0.tar.gz |
0.7.0 |
2019-11-09 |
7.3 |
Chong HE |
- Added French Backends using online source `cnrtl.fr` and `synonymo.fr`
- Added German synonym backend based on `openthesaurus.de`, backend identifier `openthesaurus_de`
- Fixed some bugs
- Added `datamuse_en` into default backends list.
- Removed defunc backends such as `thesaurus.com` and `woxikon.de` from default backend list. |
thesaurus_query.vim-0.6.3.zip |
0.6.3 |
2018-05-20 |
7.0 |
Chong HE |
Add datamuse.com as one of the default backend to alleviate the problem caused by change in thesaurus.com. |
thesaurus_query.vim-0.6.2.tar.gz |
v0.6.2 |
2017-07-10 |
7.0 |
Chong HE |
fix an unusable variable used to configure source file of Russian synonym backend: change `g:tq_yarn-synsets_file` into `g:tq_yarn_synsets_file`. |
thesaurus_query.vim-0.6.1.tar.gz |
v0.6.1 |
2017-01-28 |
7.3 |
Chong HE |
Fix issues of woxikon_de backend due to website design change |
thesaurus_query.vim-0.6.0.tar.gz |
0.6.0 |
2016-10-02 |
7.3 |
Chong HE |
Add interactive backend switching; Add Chinese backend; Add OpenOffice based English backend; Fix bug that make thesaurus replacing feature malfunction for non-English language. |
thesaurus_query.vim-0.5.1.tar.gz |
v0.5.1 |
2016-08-30 |
7.3 |
Chong HE |
#Added# `openoffice_en` backend, using OpenOffice's thesaurus extension as thesaurus source.
#Fixed# Bugs in source checking logic of `mthesaur_txt` routine when variable `&thesaurus` is searched
|
thesaurus_query.vim-0.5.0.tar.gz |
v0.5.0 |
2016-07-24 |
7.3 |
Chong HE |
dynamic backend managing; split buffer display improvement; phrase replacing algorithm improvement. |
thesaurus_query.vim-0.4.1.tar.gz |
0.4.1 |
2016-06-21 |
7.3 |
Chong HE |
Fix a bug that prevent the plugin from function properly with Python2.6 |
thesaurus_query.vim-0.4.0.tar.gz |
0.4.0 |
2016-06-01 |
7.3 |
Chong HE |
Added customizable timeout mechanism.
Visual mode query now also provide replacement functionality.
Removed datamuse.com from default backend list (to improve performance).
Improved coloring.
Minor bug fixings. |
thesaurus_query.vim-0.3.5.tar.gz |
0.3.5 |
2016-05-22 |
7.3 |
Chong HE |
Fixed multiple issues with ctrl-x ctrl-u bound insert-mode thesaurus query:
-- fix the bug making feature not responsive with Python3 built vim.
-- tab symbol '\t' now excluded from recognized word
-- invoking after non-word symbol now return empty list rather than exception. |
thesaurus_query.vim-0.3.4.tar.gz |
0.3.4 |
2016-05-21 |
7.3 |
Chong HE |
Now support mid-session change of all (except for keymapping related ) variables.
To make backend changing take effect, `:ThesaurusQueryReset` after changing `g:tq_enabled_backends` |
thesaurus_query.vim-0.3.3.tar.gz |
0.3.3 |
2016-05-15 |
7.3 |
Chong HE |
Default keybinding to `<Leader>cs`. Old keybinding `<LocalLeader>cs` still works, but the use is now depreciated. |
thesaurus_query.vim-0.3.2.tar.gz |
0.3.2 |
2016-05-14 |
7.3 |
Chong HE |
Add German thesaurus query support, through woxikon.de. |
thesaurus_query.vim-0.3.1.tar.gz |
0.3.1 |
2016-05-02 |
7.3 |
Chong HE |
Add Python3 support, and set as default. |
thesaurus_query.vim-0.3.0.tar.gz |
v0.3.0 |
2016-04-23 |
7.3 |
Chong HE |
## Added
- multi-language thesaurus query support, currently English('en') and Russian('ru') are supported
- `b:tq_language` and `g:tq_language` to setup which language source you prefer the plugin to query
- use `completefunc` for insertmode autocomplete (Issue #7)
- variable `let g:tq_use_vim_autocomplete = 1` to activate `completefunc`
## Changed
- (internal) words and query results in Python are now all utf-8 decoded
- made plugin into autoload plugin to speed-up vim startup
## Depreciated
- all variables starting with `g:thesaurus_query#`, replacing the prefix of all of them by `g:tq_`
## Removed
- variable `g:thesaurus_query#map_keys`, use `g:tq_map_keys` instead.
## Fixed
- fix out-of-bound user input exception in candidate choosing.
- add `KeyboardInterrupt` exception handler for candidate choosing.(closes Issue #8 )
|
thesaurus_query.0.2.1.tar.gz |
0.2.1 |
2016-04-10 |
7.3 |
Chong HE |
plugin is now autoload plugin to speed-up vim startup |
thesaurus_query.vim-0.2.0.tar.gz |
0.2.0 |
2016-03-25 |
7.2 |
Chong HE |
V0.2 Changelog
* Added
- datamuse query routine
- implement backend enable/disable by `g:thesaurus_query#enabled_backends`
- add query system reset function `:ThesaurusQueryReset`
* Depreciated
- use of variable `g:thesaurus_query#use_local_thesaurus_source_as_primary`
* Removed
- variable `g:thesaurus_query#use_alternative_backend`
|
thesaurus_query.vim-0.1.1.zip |
0.1.1 |
2016-03-13 |
7.2 |
Chong HE |
* Same as 0.1.0d. Released as the first stable version. The plugin is verified to be working on vim 7.3 and 7.2 version. |
thesaurus_query.vim-version0_1_0.zip |
0.1.0-d |
2016-03-09 |
7.3 |
Chong HE |
fix :Thesaurus <word_input> functionality. |
thesaurus_query.vim-version0_1_0.zip |
0.1.0-c |
2016-03-06 |
7.3 |
Chong HE |
fix a bug that the plugin replace a wrong word on vims with `w` `c` or `b` remapped to other functions. |
thesaurus_query.vim-0.1.0-beta.zip |
0.1.0-b |
2016-03-05 |
7.3 |
Chong HE |
Add backend priority swapping mechanism. Backend that return error when query will have its priority lowered.
Further improve synonym replacing interface.
Fix issue that might block plugin updating through plugin manager. |
thesaurus_query.vim-0.1.0-alpha.zip |
0.1.0-a |
2016-03-03 |
7.3 |
Chong HE |
Add local query backend based on parsing `mthesaur.txt`.
Refined synonym replacing interface
Improved synonym replacing algorithm |
thesaurus_query.vim-version0_0_2.zip |
0.0.2 |
2016-02-26 |
7.3 |
Chong HE |
User Interface improvement(mainly the replace candidate choosing interface).
Bug fix.
Add synonym output size control but currently inactive by default. |
thesaurus_query.vim.tar.gz |
0.0.1 |
2016-02-26 |
7.3 |
Chong HE |
Initial upload |