import fugashi
tagger = fugashi.GenericTagger('-d/usr/local/lib/mecab/dic/ipadic')
It's also possible to specify dictionary fields so you can get convenient access to features no matter what dictionary you use.
import fugashi
the wrapper is just a namedtuple with a default value of None for all fields
MyDictFeatures = fugashi.create_dict_wrapper('MyDictFeatures', 'lemma alpha beta'.split())
tagger = fugashi.GenericTagger('-d/usr/local/lib/mecab/dic/customdic', MyDictFeatures)
nodes = tagger.parseToNodes('blah blah')
node = nodes[0]
print(node.lemma, node.alpha, node.beta)
Some other changes:
- the raw feature string is now available as `.feature_raw` on nodes
- packaging-related fixes
- initial [mecab-ko-dic](https://bitbucket.org/eunjeon/mecab-ko-dic) (Korean) support; needs more testing