Commit 5f2cbd8c authored by c24b's avatar c24b

[rloth] feature on command: Perceptron() instead of pos_tag()

parent a5ab826d
#!/usr/bin/python env
from ._Tagger import Tagger
import nltk
#from nltk import pos_tag
from nltk.tag.perceptron import PerceptronTagger
class NltkTagger(Tagger):
'''Require maxtree'''
#import nltk
def __init__(self, *args, **kwargs):
self.tagr = PerceptronTagger()
super(self.__class__, self).__init__(*args, **kwargs)
#~ def __start__(self):
#~ self.tagr = PerceptronTagger()
def tag_tokens(self, tokens, single=True):
return nltk.pos_tag(tokens)
return self.tagr.tag(tokens)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment