Any dict plugin to translate English to Japanese?

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

Any dict plugin to translate English to Japanese?

robert song-2
Hi, everyone.

Is there any vim plugin which can search for one English word and
translate it into Japanese?

And any free dict file?

Regards,
  robert

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: Any dict plugin to translate English to Japanese?

tyru-2
http://alc.co.jp/ supports English to Japanese, Japanese to English.
and if you want to look up in vim,
ref.vim is good.
http://www.vim.org/scripts/script.php?script_id=3067

" Translate "word" to Japanese.
:Ref alc word
" Translate "単語" to English.
:Ref alc 単語

> And any free dict file?
alc.co.jp also sell dict file?
I don't know well though.

On Thu, Feb 24, 2011 at 10:09 AM, robert song
<[hidden email]> wrote:

> Hi, everyone.
>
> Is there any vim plugin which can search for one English word and
> translate it into Japanese?
>
> And any free dict file?
>
> Regards,
>  robert
>
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: Any dict plugin to translate English to Japanese?

robert song-2
Hi, tyru,
thank you very much.

On 2/24/11, tyru <[hidden email]> wrote:
> http://alc.co.jp/ supports English to Japanese, Japanese to English.
> and if you want to look up in vim,
> ref.vim is good.
> http://www.vim.org/scripts/script.php?script_id=3067
>
> " Translate "word" to Japanese.
> :Ref alc word
> " Translate "単語" to English.
> :Ref alc 単語

I run the command in vim, but it fails with SEGV.

>
>> And any free dict file?
> alc.co.jp also sell dict file?
> I don't know well though.
>

There are some free dict file like
http://www.namazu.org/~tsuchiya/sdic/data/gene.html

But it only translate English to Japanese, and is very simple.

Regards,
  robert

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: Any dict plugin to translate English to Japanese?

robert song-2
In reply to this post by tyru-2
By the way, there is another plugin
cursoroverdictionary : Look up word or phrase in English-Japanese
Dictionary
http://www.vim.org/scripts/script.php?script_id=2680

which can do the work.

On 2/24/11, tyru <[hidden email]> wrote:

> http://alc.co.jp/ supports English to Japanese, Japanese to English.
> and if you want to look up in vim,
> ref.vim is good.
> http://www.vim.org/scripts/script.php?script_id=3067
>
> " Translate "word" to Japanese.
> :Ref alc word
> " Translate "単語" to English.
> :Ref alc 単語
>
>> And any free dict file?
> alc.co.jp also sell dict file?
> I don't know well though.
>
> On Thu, Feb 24, 2011 at 10:09 AM, robert song
> <[hidden email]> wrote:
>> Hi, everyone.
>>
>> Is there any vim plugin which can search for one English word and
>> translate it into Japanese?
>>
>> And any free dict file?
>>
>> Regards,
>>  robert
>>
>> --
>> You received this message from the "vim_use" maillist.
>> Do not top-post! Type your reply below the text you are replying to.
>> For more information, visit http://www.vim.org/maillist.php
>>
>
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: Any dict plugin to translate English to Japanese?

tyru-2
In reply to this post by robert song-2
> I run the command in vim, but it fails with SEGV.
Vim does segfault? strange.
but at least, segfault seems that it is not vim plugin's bug, but Vim's bug.
you must install one of w3m, lynx, elinks, links to get content
according to :help ref-alc
(oh I found that ref.vim does not have english help. I will report or
send pull request to ref.vim's author)

Please tell me your Vim's version and OS.
and check if you installed program required for ref-alc source.

2011/2/25 robert song <[hidden email]>:

> Hi, tyru,
> thank you very much.
>
> On 2/24/11, tyru <[hidden email]> wrote:
>> http://alc.co.jp/ supports English to Japanese, Japanese to English.
>> and if you want to look up in vim,
>> ref.vim is good.
>> http://www.vim.org/scripts/script.php?script_id=3067
>>
>> " Translate "word" to Japanese.
>> :Ref alc word
>> " Translate "単語" to English.
>> :Ref alc 単語
>
> I run the command in vim, but it fails with SEGV.
>
>>
>>> And any free dict file?
>> alc.co.jp also sell dict file?
>> I don't know well though.
>>
>
> There are some free dict file like
> http://www.namazu.org/~tsuchiya/sdic/data/gene.html
>
> But it only translate English to Japanese, and is very simple.
>
> Regards,
>  robert
>
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: Any dict plugin to translate English to Japanese?

tyru-2
In reply to this post by robert song-2
I haven't used cursoroverdictionary yet
but it also seems a interesting and extensible plugin.
to read his japanese blog entries:
  http://d.hatena.ne.jp/ampmmn/searchdiary?word=cursoroverdictionary

cursoroverdictionary's features:
- it has operator to search from alc.co.jp
  - hmm, I don't want that because I want to select a query
    without text-object in most cases like Vim's gf command behavior.
    operator feels too much feature for me.
- it can define query like the followings:
call cursoroverdictionary#add("boost",
'http://www.kmonos.net/alang/boost/classes/{word}.html', "utf-8",
"utf-8")
call cursoroverdictionary#set_trim_pattern("boost", '</head><body>', '')
command! -nargs=* LetsBoost CODSearchEx boost <args>
  - ref.vim does not have the feature currently because it is not only
for alc dictionary.
    it is an interface for perldoc, pydoc, man, and so on.
    I think it is not difficult to implement a similar feature in ref.vim

ref.vim's features:
- it supports many sources
  - alc, clojure, erlang, hoogle, man, perldoc, phpmanual, pydoc, refe
- there are many users so it is well-tested plugin.
- you can define a own source (:help ref-sources).
  - it is fully customizable
- you can use K ("<Plug>(ref-keyword)"), which is the same behavior as
Vim's K command at default.
  - but for example, in perldoc buffer, it looks up a perl module.
- for me, thinca who is the author of ref.vim is my friend so I
quickly can send a bug report/patch/feature request! :p

2011/2/25 robert song <[hidden email]>:

> By the way, there is another plugin
> cursoroverdictionary : Look up word or phrase in English-Japanese
> Dictionary
> http://www.vim.org/scripts/script.php?script_id=2680
>
> which can do the work.
>
> On 2/24/11, tyru <[hidden email]> wrote:
>> http://alc.co.jp/ supports English to Japanese, Japanese to English.
>> and if you want to look up in vim,
>> ref.vim is good.
>> http://www.vim.org/scripts/script.php?script_id=3067
>>
>> " Translate "word" to Japanese.
>> :Ref alc word
>> " Translate "単語" to English.
>> :Ref alc 単語
>>
>>> And any free dict file?
>> alc.co.jp also sell dict file?
>> I don't know well though.
>>
>> On Thu, Feb 24, 2011 at 10:09 AM, robert song
>> <[hidden email]> wrote:
>>> Hi, everyone.
>>>
>>> Is there any vim plugin which can search for one English word and
>>> translate it into Japanese?
>>>
>>> And any free dict file?
>>>
>>> Regards,
>>>  robert
>>>
>>> --
>>> You received this message from the "vim_use" maillist.
>>> Do not top-post! Type your reply below the text you are replying to.
>>> For more information, visit http://www.vim.org/maillist.php
>>>
>>
>> --
>> You received this message from the "vim_use" maillist.
>> Do not top-post! Type your reply below the text you are replying to.
>> For more information, visit http://www.vim.org/maillist.php
>>
>
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: Any dict plugin to translate English to Japanese?

robert song-2
In reply to this post by tyru-2
Hi, tyru,

On 2/25/11, tyru <[hidden email]> wrote:

>> I run the command in vim, but it fails with SEGV.
> Vim does segfault? strange.
> but at least, segfault seems that it is not vim plugin's bug, but Vim's bug.
> you must install one of w3m, lynx, elinks, links to get content
> according to :help ref-alc
> (oh I found that ref.vim does not have english help. I will report or
> send pull request to ref.vim's author)
>
> Please tell me your Vim's version and OS.
> and check if you installed program required for ref-alc source.

yes, I install w3m.
And I set  the following comand in ~/.vimrc.
let g:ref_alc_cmd='w3m -dump %s'

I use CentOS 5.5 and vim version is
vim-enhanced-7.0.109-6.el5

Regards,
  robert

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: Any dict plugin to translate English to Japanese?

robert song-2
In reply to this post by tyru-2
On 2/25/11, tyru <[hidden email]> wrote:

> I haven't used cursoroverdictionary yet
> but it also seems a interesting and extensible plugin.
> to read his japanese blog entries:
>   http://d.hatena.ne.jp/ampmmn/searchdiary?word=cursoroverdictionary
>
> cursoroverdictionary's features:
> - it has operator to search from alc.co.jp
>   - hmm, I don't want that because I want to select a query
>     without text-object in most cases like Vim's gf command behavior.
>     operator feels too much feature for me.
> - it can define query like the followings:
> call cursoroverdictionary#add("boost",
> 'http://www.kmonos.net/alang/boost/classes/{word}.html', "utf-8",
> "utf-8")
> call cursoroverdictionary#set_trim_pattern("boost", '</head><body>', '')
> command! -nargs=* LetsBoost CODSearchEx boost <args>
>   - ref.vim does not have the feature currently because it is not only
> for alc dictionary.
>     it is an interface for perldoc, pydoc, man, and so on.
>     I think it is not difficult to implement a similar feature in ref.vim
>
> ref.vim's features:
> - it supports many sources
>   - alc, clojure, erlang, hoogle, man, perldoc, phpmanual, pydoc, refe
> - there are many users so it is well-tested plugin.
> - you can define a own source (:help ref-sources).
>   - it is fully customizable
> - you can use K ("<Plug>(ref-keyword)"), which is the same behavior as
> Vim's K command at default.
>   - but for example, in perldoc buffer, it looks up a perl module.
> - for me, thinca who is the author of ref.vim is my friend so I
> quickly can send a bug report/patch/feature request! :p

there is a function in cursoroverdictionary, if we have a local
dictionary file, we can use CODRegisteDict to create a database file
from the file, and use :CODToggle to open a new windows, and in
another windows of vim, as the pointer moves to another place, the
word will be translated and displayed on the dict window, that is why I
want to use a local dictionary file, I think this way seems to more
convenient.

Of course, I will try to use ref.vim and it also seems to be a nice
one. :)

Regards,
  robert

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: Any dict plugin to translate English to Japanese?

robert song-2
On 2/25/11, robert song <[hidden email]> wrote:

> On 2/25/11, tyru <[hidden email]> wrote:
>> I haven't used cursoroverdictionary yet
>> but it also seems a interesting and extensible plugin.
>> to read his japanese blog entries:
>>   http://d.hatena.ne.jp/ampmmn/searchdiary?word=cursoroverdictionary
>>
>> cursoroverdictionary's features:
>> - it has operator to search from alc.co.jp
>>   - hmm, I don't want that because I want to select a query
>>     without text-object in most cases like Vim's gf command behavior.
>>     operator feels too much feature for me.
>> - it can define query like the followings:
>> call cursoroverdictionary#add("boost",
>> 'http://www.kmonos.net/alang/boost/classes/{word}.html', "utf-8",
>> "utf-8")
>> call cursoroverdictionary#set_trim_pattern("boost", '</head><body>', '')
>> command! -nargs=* LetsBoost CODSearchEx boost <args>
>>   - ref.vim does not have the feature currently because it is not only
>> for alc dictionary.
>>     it is an interface for perldoc, pydoc, man, and so on.
>>     I think it is not difficult to implement a similar feature in ref.vim
>>
>> ref.vim's features:
>> - it supports many sources
>>   - alc, clojure, erlang, hoogle, man, perldoc, phpmanual, pydoc, refe
>> - there are many users so it is well-tested plugin.
>> - you can define a own source (:help ref-sources).
>>   - it is fully customizable
>> - you can use K ("<Plug>(ref-keyword)"), which is the same behavior as
>> Vim's K command at default.
>>   - but for example, in perldoc buffer, it looks up a perl module.
>> - for me, thinca who is the author of ref.vim is my friend so I
>> quickly can send a bug report/patch/feature request! :p
>
> there is a function in cursoroverdictionary, if we have a local
> dictionary file, we can use CODRegisteDict to create a database file
> from the file, and use :CODToggle to open a new windows, and in
> another windows of vim, as the pointer moves to another place, the
> word will be translated and displayed on the dict window, that is why I
> want to use a local dictionary file, I think this way seems to more
> convenient.
>
> Of course, I will try to use ref.vim and it also seems to be a nice
> one. :)
>
> Regards,
>   robert
>

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: Any dict plugin to translate English to Japanese?

robert song-2
A very simple function to dump the selected word from dic yahoo and show the
result.


Add the following part to .vimrc file.

function Dict(cmd)
  execute "new"
  execute "r!w3m -dump http://dic.yahoo.co.jp/search?p=". a:cmd
  normal gg
endfunction
com -nargs=* Dict call Dict(<f-args>)
vmap <C-\>q y:Dict <C-R>0<CR>
nmap <C-\>q :Dict <C-R>=expand("<cword>")<CR><CR>

Best Regards,
  robert


On 2/25/11, robert song <[hidden email]> wrote:

> On 2/25/11, robert song <[hidden email]> wrote:
>> On 2/25/11, tyru <[hidden email]> wrote:
>>> I haven't used cursoroverdictionary yet
>>> but it also seems a interesting and extensible plugin.
>>> to read his japanese blog entries:
>>>   http://d.hatena.ne.jp/ampmmn/searchdiary?word=cursoroverdictionary
>>>
>>> cursoroverdictionary's features:
>>> - it has operator to search from alc.co.jp
>>>   - hmm, I don't want that because I want to select a query
>>>     without text-object in most cases like Vim's gf command behavior.
>>>     operator feels too much feature for me.
>>> - it can define query like the followings:
>>> call cursoroverdictionary#add("boost",
>>> 'http://www.kmonos.net/alang/boost/classes/{word}.html', "utf-8",
>>> "utf-8")
>>> call cursoroverdictionary#set_trim_pattern("boost", '</head><body>', '')
>>> command! -nargs=* LetsBoost CODSearchEx boost <args>
>>>   - ref.vim does not have the feature currently because it is not only
>>> for alc dictionary.
>>>     it is an interface for perldoc, pydoc, man, and so on.
>>>     I think it is not difficult to implement a similar feature in
>>> ref.vim
>>>
>>> ref.vim's features:
>>> - it supports many sources
>>>   - alc, clojure, erlang, hoogle, man, perldoc, phpmanual, pydoc, refe
>>> - there are many users so it is well-tested plugin.
>>> - you can define a own source (:help ref-sources).
>>>   - it is fully customizable
>>> - you can use K ("<Plug>(ref-keyword)"), which is the same behavior as
>>> Vim's K command at default.
>>>   - but for example, in perldoc buffer, it looks up a perl module.
>>> - for me, thinca who is the author of ref.vim is my friend so I
>>> quickly can send a bug report/patch/feature request! :p
>>
>> there is a function in cursoroverdictionary, if we have a local
>> dictionary file, we can use CODRegisteDict to create a database file
>> from the file, and use :CODToggle to open a new windows, and in
>> another windows of vim, as the pointer moves to another place, the
>> word will be translated and displayed on the dict window, that is why I
>> want to use a local dictionary file, I think this way seems to more
>> convenient.
>>
>> Of course, I will try to use ref.vim and it also seems to be a nice
>> one. :)
>>
>> Regards,
>>   robert
>>
>

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: Any dict plugin to translate English to Japanese?

tyru-2
In reply to this post by robert song-2
> I use CentOS 5.5 and vim version is
> vim-enhanced-7.0.109-6.el5
hmm.. I don't have vim older than 7.2 so I can't test that.
I recommend to upgrade your vim.

On Fri, Feb 25, 2011 at 5:05 PM, robert song <[hidden email]> wrote:

> Hi, tyru,
>
> On 2/25/11, tyru <[hidden email]> wrote:
>>> I run the command in vim, but it fails with SEGV.
>> Vim does segfault? strange.
>> but at least, segfault seems that it is not vim plugin's bug, but Vim's bug.
>> you must install one of w3m, lynx, elinks, links to get content
>> according to :help ref-alc
>> (oh I found that ref.vim does not have english help. I will report or
>> send pull request to ref.vim's author)
>>
>> Please tell me your Vim's version and OS.
>> and check if you installed program required for ref-alc source.
>
> yes, I install w3m.
> And I set  the following comand in ~/.vimrc.
> let g:ref_alc_cmd='w3m -dump %s'
>
> I use CentOS 5.5 and vim version is
> vim-enhanced-7.0.109-6.el5
>
> Regards,
>  robert
>
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: Any dict plugin to translate English to Japanese?

Christian Brabandt
In reply to this post by robert song-2
On Fri, February 25, 2011 9:05 am, robert song wrote:

> On 2/25/11, tyru <[hidden email]> wrote:
>>> I run the command in vim, but it fails with SEGV.
>> Vim does segfault? strange.
>> but at least, segfault seems that it is not vim plugin's bug, but Vim's
>> bug.
>> you must install one of w3m, lynx, elinks, links to get content
>> according to :help ref-alc
>> (oh I found that ref.vim does not have english help. I will report or
>> send pull request to ref.vim's author)
>>
>> Please tell me your Vim's version and OS.
>> and check if you installed program required for ref-alc source.
>
> yes, I install w3m.
> And I set  the following comand in ~/.vimrc.
> let g:ref_alc_cmd='w3m -dump %s'
>
> I use CentOS 5.5 and vim version is
> vim-enhanced-7.0.109-6.el5

Before reporting a bug, please try the latest version from the Vim
repository and please provide a way to reproduce the crash.

regards,
Christian

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: Any dict plugin to translate English to Japanese?

tyru-2
In reply to this post by robert song-2
> there is a function in cursoroverdictionary, if we have a local
> dictionary file, we can use CODRegisteDict to create a database file
> from the file, and use :CODToggle to open a new windows, and in
> another windows of vim, as the pointer moves to another place, the
> word will be translated and displayed on the dict window, that is why I
> want to use a local dictionary file, I think this way seems to more
> convenient.
looks interesting. I will let thinca support that maybe? :-)

> Of course, I will try to use ref.vim and it also seems to be a nice
> one. :)
yeah, ref.vim is nice but cursoroverdictionary seems to fit your requirements.
I think ref.vim is overspec just to look up an English or Japanese word.

On Fri, Feb 25, 2011 at 5:14 PM, robert song <[hidden email]> wrote:

> On 2/25/11, tyru <[hidden email]> wrote:
>> I haven't used cursoroverdictionary yet
>> but it also seems a interesting and extensible plugin.
>> to read his japanese blog entries:
>>   http://d.hatena.ne.jp/ampmmn/searchdiary?word=cursoroverdictionary
>>
>> cursoroverdictionary's features:
>> - it has operator to search from alc.co.jp
>>   - hmm, I don't want that because I want to select a query
>>     without text-object in most cases like Vim's gf command behavior.
>>     operator feels too much feature for me.
>> - it can define query like the followings:
>> call cursoroverdictionary#add("boost",
>> 'http://www.kmonos.net/alang/boost/classes/{word}.html', "utf-8",
>> "utf-8")
>> call cursoroverdictionary#set_trim_pattern("boost", '</head><body>', '')
>> command! -nargs=* LetsBoost CODSearchEx boost <args>
>>   - ref.vim does not have the feature currently because it is not only
>> for alc dictionary.
>>     it is an interface for perldoc, pydoc, man, and so on.
>>     I think it is not difficult to implement a similar feature in ref.vim
>>
>> ref.vim's features:
>> - it supports many sources
>>   - alc, clojure, erlang, hoogle, man, perldoc, phpmanual, pydoc, refe
>> - there are many users so it is well-tested plugin.
>> - you can define a own source (:help ref-sources).
>>   - it is fully customizable
>> - you can use K ("<Plug>(ref-keyword)"), which is the same behavior as
>> Vim's K command at default.
>>   - but for example, in perldoc buffer, it looks up a perl module.
>> - for me, thinca who is the author of ref.vim is my friend so I
>> quickly can send a bug report/patch/feature request! :p
>
> there is a function in cursoroverdictionary, if we have a local
> dictionary file, we can use CODRegisteDict to create a database file
> from the file, and use :CODToggle to open a new windows, and in
> another windows of vim, as the pointer moves to another place, the
> word will be translated and displayed on the dict window, that is why I
> want to use a local dictionary file, I think this way seems to more
> convenient.
>
> Of course, I will try to use ref.vim and it also seems to be a nice
> one. :)
>
> Regards,
>  robert
>
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: Any dict plugin to translate English to Japanese?

robert song-2
In reply to this post by tyru-2
On 2/25/11, tyru <[hidden email]> wrote:
>> I use CentOS 5.5 and vim version is
>> vim-enhanced-7.0.109-6.el5
> hmm.. I don't have vim older than 7.2 so I can't test that.
> I recommend to upgrade your vim.
>

Hi, tyru,
yeah, you are correct,
after upgrading to the latest 7.3, there is no problem.

Well, as a stable distribution, CentOS is not upgraded so frequently.
:)

Best Wishes,
  robert

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: Any dict plugin to translate English to Japanese?

robert song-2
In reply to this post by robert song-2
Another simple function to dump the result to yahoo dic to quickfix window.

function Dict(cmd)
  let tmpfile = tempname()
  let l:list=system("w3m -dump http://dic.yahoo.co.jp/search?p=" . a:cmd)
  exe "redir! > " . tmpfile
  silent echon l:list
  redir END
  if exists(":cgetfile")
      execute "silent! cgetfile " . tmpfile
  else
      execute "silent! cfile " . tmpfile
  endif
  " Open the quickfix window below the current window
  botright copen
  execute "/全.*件"
  call delete(tmpfile)
endfunction

com -nargs=* Dict call Dict(<f-args>)
vmap <C-\>q y:Dict <C-R>0<CR>
nmap <C-\>q :Dict <C-R>=expand("<cword>")<CR><CR>


Regards,
  robert

On 2/25/11, robert song <[hidden email]> wrote:

> A very simple function to dump the selected word from dic yahoo and show
> the
> result.
>
>
> Add the following part to .vimrc file.
>
> function Dict(cmd)
>   execute "new"
>   execute "r!w3m -dump http://dic.yahoo.co.jp/search?p=". a:cmd
>   normal gg
> endfunction
> com -nargs=* Dict call Dict(<f-args>)
> vmap <C-\>q y:Dict <C-R>0<CR>
> nmap <C-\>q :Dict <C-R>=expand("<cword>")<CR><CR>
>

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php