Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I find Some Bugs #121

Open
zhangsanqiang opened this issue Mar 8, 2019 · 1 comment
Open

I find Some Bugs #121

zhangsanqiang opened this issue Mar 8, 2019 · 1 comment

Comments

@zhangsanqiang
Copy link

import pynlpir
pynlpir.open()
s='1930年后赴国立青岛大学(国立山东大学前身)执教,到抗战前,出版了20多个作品集,有《石子船》、《虎雏》、《月下小景》、《八骏图》等。'
segments = pynlpir.segment(s,pos_names='all')

part of speech not recognized: 'gjtgj'

TypeError Traceback (most recent call last)
in ()
2 pynlpir.open()
3 s='1930年后赴国立青岛大学(国立山东大学前身)执教,到抗战前,出版了20多个作品集,有《石子船》、《虎雏》、《月下小景》、《八骏图》等。'
----> 4 segments = pynlpir.segment(s,pos_names='all')
5 for segment in segments:
6 print(segment[0],'\t',segment[1])

C:\Users\ozo\Anaconda3\lib\site-packages\pynlpir_init_.py in segment(s, pos_tagging, pos_names, pos_english)
246 token = (token[0], None)
247 if pos_names is not None and token[1] is not None:
--> 248 pos_name = _get_pos_name(token[1], pos_names, pos_english)
249 token = (token[0], pos_name)
250 tokens[i] = token

C:\Users\ozo\Anaconda3\lib\site-packages\pynlpir_init_.py in _get_pos_name(code, name, english, delimiter)
192 """
193 pos_name = pos_map.get_pos_name(code, name, english)
--> 194 return delimiter.join(pos_name) if name == 'all' else pos_name
195
196

### TypeError: can only join an iterable

import pynlpir
pynlpir.open()
s='1930年后赴国立青岛大学(国立山东大学前身)执教,到抗战前,出版了20多个作品集,有《石子船》、《虎雏》、《月下小景》、《八骏图》等。'
segments = pynlpir.segment(s,pos_names='parent')
for segment in segments:
    print(segment[0],'\t',segment[1])

part of speech not recognized: 'gjtgj'

### 船 None

@zhangsanqiang
Copy link
Author

i know some words are not in the dicts.
So the segment result of the tag is 'None'
But why their tags can't be iterate.
i think the OOV(Out of Vocabulary) also need a tag. And allow users to add in the dicts by the right way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant