hideaki-t / igo-python Goto Github PK
View Code? Open in Web Editor NEWPython port of Igo Japanese morphological analyzer
License: Other
Python port of Igo Japanese morphological analyzer
License: Other
IronPython's UTF-16-LE decoder only accepts a string, it does not accept an array.
now it has builtin dictionary, simple parsing tests can be added easily.
When igo-python tries to parse a sentence with emoji, a word after the emoji is combined with it in surface.
For example,
In [1]: from igo.Tagger import Tagger
In [2]: t = Tagger()
In [3]: s = 'おはようー😳こんにちはー美味しいご飯だよ'
In [4]: for m in t.parse(s):
print(m)
...:
surface: おはよう, feature: 感動詞,*,*,*,*,*,おはよう,オハヨウ,オハヨー, start=0
surface: ー, feature: 名詞,一般,*,*,*,*,*, start=4
surface: 😳こ, feature: 記号,一般,*,*,*,*,*, start=5
surface: んにちはー, feature: 感動詞,*,*,*,*,*,こんにちは,コンニチハ,コンニチワ, start=7
surface: 美, feature: 名詞,一般,*,*,*,*,*, start=12
surface: 味しいご, feature: 形容詞,自立,*,*,形容詞・イ段,基本形,美味しい,オイシイ,オイシイ, start=13
surface: 飯だ, feature: 名詞,一般,*,*,*,*,ご飯,ゴハン,ゴハン, start=17
surface: よ, feature: 助動詞,*,*,*,特殊・ダ,基本形,だ,ダ,ダ, start=19
surface: , feature: 助詞,終助詞,*,*,*,*,よ,ヨ,ヨ, start=20
The correct output is like
surface: おはよう, feature: 感動詞,*,*,*,*,*,おはよう,オハヨウ,オハヨー, start=0
surface: ー, feature: 名詞,一般,*,*,*,*,*, start=4
surface: 😳, feature: 記号,一般,*,*,*,*,*, start=5
surface: こんにちは, feature: 感動詞,*,*,*,*,*,こんにちは,コンニチハ,コンニチワ, start=6
surface: ー, feature: 名詞,一般,*,*,*,*,*, start=11
surface: 美味しい, feature: 形容詞,自立,*,*,形容詞・イ段,基本形,美味しい,オイシイ,オイシイ, start=12
surface: ご飯, feature: 名詞,一般,*,*,*,*,ご飯,ゴハン,ゴハン, start=16
surface: だ, feature: 助動詞,*,*,*,特殊・ダ,基本形,だ,ダ,ダ, start=18
surface: よ, feature: 助詞,終助詞,*,*,*,*,よ,ヨ,ヨ, start=19
this issue is reproducible in igo-python 0.9.7 and newer versions.
the latest, 0.9.8, works fine on python 2.7, 3.4, 3.5, 3.6, pypy, pypy3.
0.9.6 works fine on python 3.3.
0.9.8 works fine on python 3.3 if use_mmap=False
expected result
>>> import igo; [x.feature for x in igo.tagger.Tagger('ipadic').parse('私の名前は中野です')]
['名詞,代名詞,一般,*,*,*,私,ワタシ,ワタシ', '助詞,連体化,*,*,*,*,の,ノ,ノ', '名詞,一般,*,*,*,*,名前,ナマエ,ナマエ', '助詞,係助詞,*,*,*,*,は,ハ,ワ', '名詞,固有名詞,地域,一般,*,*,中野,ナカノ,ナカノ', '助動詞,*,*,*,特殊・デス,基本形,です,デス,デス']
on python 3.3
>>> import igo; [x.feature for x in igo.tagger.Tagger('ipadic').parse('私の名前は中野です')]
['名詞,一般,*,*,*,*,*', '名詞,一般,*,*,*,*,*', '名詞,一般,*,*,*,*,*', '名詞,一般,*,*,*,*,*', '名詞,一般,*,*,*,*,*', '名詞,一般,*,*,*,*,*']
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.