Code Monkey home page Code Monkey logo

igo-python's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

inamori ogra

igo-python's Issues

add unittest

now it has builtin dictionary, simple parsing tests can be added easily.

Word after emoji is combined with the emoji in surface.

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

returned features are wrong on python 3.3

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('私の名前は中野です')]
['名詞,一般,*,*,*,*,*', '名詞,一般,*,*,*,*,*', '名詞,一般,*,*,*,*,*', '名詞,一般,*,*,*,*,*', '名詞,一般,*,*,*,*,*', '名詞,一般,*,*,*,*,*']

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.