ujihisa / neco-look

A neocomplcache plugin for English, using look command

Home Page:http://www.vim.org/scripts/script.php?script_id=3440

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pattern not found.

scrouthtv opened this issue · comments

I installed neco-look alongside deoplete. I downloaded german.dic which looks like this:

AA
AAA
Aachen
Aachener
Aachenerin
Aachenerinnen
Aachenern
Aacheners
Aachenfahrt
Aachenfahrten
Aachens
Aadorf
Aadorfs
Aal
aalähnlich
...

Then I added this line to my nvim config:

let g:deoplete#look#words = "/home/x/.config/nvim/german.dic"

Now if I go into a test.txt file and type aal (for the very last completion of the snippet provided above) and hit C-n, it says Pattern not found:
image
It does not work for any other completion in the dictionary file provided either.

I am running

Linux archlinux 5.6.7-arch1-1 #1 SMP PREEMPT Thu, 23 Apr 2020 09:13:56 +0000 x86_64 GNU/Linux

and have look installed:

 $ which look
/usr/bin/look

What am I missing?

Thanks for reporting! Confirmed that I can reproduce it. Let me try fixing this problem.

(Probably because of these https://github.com/ujihisa/neco-look/blob/master/rplugin/python3/deoplete/sources/look.py#L54)

Aha https://github.com/ujihisa/neco-look/blob/master/rplugin/python3/deoplete/sources/look.py#L17 the minimal number of chars to trigger neco-look completion was 4.

You can disable Pattern not found message by:

set shortmess+=c

Aha https://github.com/ujihisa/neco-look/blob/master/rplugin/python3/deoplete/sources/look.py#L17 the minimal number of chars to trigger neco-look completion was 4.

Yes. So the problem is expected.

Does not work for me with longer prefixes either:

 $ grep Rindf .config/nvim/german.dic | head -n 5
Rindfleisch
Rindfleischbolognese
Rindfleischbranche
Rindfleischcevapcici
Rindfleischetikettierung

In nvim:

Rindfleis<C-n>

Pattern not foud

image
My config is as this:

set runtimepath^=~/.vim runtimepath+=~/.vim/after
let &packpath = &runtimepath
source ~/.vimrc

"let g:python_host_prog = '/usr/bin/python2'
let g:python3_host_prog = '/usr/bin/python3'
let g:loaded_python_provider = 0

filetype plugin on
syntax on
set timeoutlen=200

call plug#begin()
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'ujihisa/neco-look'
call plug#end()

let g:deoplete#enable_at_startup = 1
let g:deoplete#look#words = "/home/lenni/.config/nvim/german.dic"

What am I missing @ujihisa ?

Please upload the german dictionary file.
I need to test.

スクリーンショット_2020-05-06_11-19-49

Unfortunately, it works for me.

My minimal vimrc.

set rtp+=~/work/deoplete.nvim/
set rtp+=~/src/neco-look
" set rtp+=~/src/deoplete-jedi
" set rtp+=~/src/ultisnips

let g:deoplete#enable_at_startup = 1
let g:deoplete#look#words = "/home/shougo/work/german.dic"

"let g:python_host_prog = '/usr/bin/python2'
let g:python3_host_prog = '/usr/bin/python3'
let g:loaded_python_provider = 0

filetype plugin on
syntax on
set timeoutlen=200

I think your deoplete is not installed or worked.

Please upload :checkhealth result

And

set runtimepath^=~/.vim runtimepath+=~/.vim/after
let &packpath = &runtimepath
source ~/.vimrc

This is not minimal config.
Why you need to load ~/.vimrc in minimal config?

It is not both deoplete and neco-look's issue.
Because it works for me in minimal vimrc.

Every other completion of deoplete works perfect for me, checkhealth works too.

It's actually an issue of look:

 ~/.config/nvim > cat german.dic
ältester
Rindfleisch
 ~/.config/nvim > look Rindf german.dic

I didn't leave anything out in the dictionary file, it's only those two lines.
My lang is set to en_US.UTF-8. That in conjunction with the german umlauts (ä) might be what's wrong here..

Thanks for your help.

PS. if I have a problem setting up deoplete should I open an issue there or could you help me here?

Now fixed:

 ~/.config/nvim > look Rindf german.dic | head -n 5
Rindfleisch
Rindfleischbolognese
Rindfleischbranche
Rindfleischbr�he
Rindfleischcevapcici

I had to sort the file not by UTF-8, but by C collate:

 ~/.config/nvim > LC_COLLATE=C sort german.dic -o german.dic

Also see https://unix.stackexchange.com/questions/584954/coreutils-look-with-german-umlauts/584974#584974 and https://manpages.debian.org/stretch/bsdmainutils/look.1.en.html#BUGS.

It now prints me thens of thousands of words :)
image

Thanks for the help everyone involved!

Also, how would I reduce the required length to trigger completion (#23 (comment))?

Also, how would I reduce the required length to trigger completion (#23 (comment))?

call deoplete#custom#source('look', 'min_pattern_length', 2)

Please read deoplete-options-min_pattern_length.