You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
taggers.py
def parse_sentence(self, tokens):
if self.use_pos:
tokens = self.pos_tagger.tag_tokens(tokens, return_tokens=True)
#if not using pos. tokens are not tuple.
for token in tokens:
if self.use_pos:
word, pos = token
else:
pos = None
#if not using pos, word is referenced before assignment
tokens_obj.append(attributes.Token(word, pos=pos))
Here is my traceback
PC:2016_NLPNET user$ python bin/nlpnet-tag.py dependency
It was home.
Traceback (most recent call last):
File "bin/nlpnet-tag.py", line 120, in <module>
interactive_running(args)
File "bin/nlpnet-tag.py", line 48, in interactive_running
result = tagger.tag(text)
File "/Users/username/anaconda/lib/python2.7/site-packages/nlpnet/taggers.py", line 398, in tag
return self.parse(text)
File "/Users/username/anaconda/lib/python2.7/site-packages/nlpnet/taggers.py", line 336, in parse
parsed = self.parse_sentence(sent)
File "/Users/username/anaconda/lib/python2.7/site-packages/nlpnet/taggers.py", line 369, in parse_sentence
tokens_obj.append(attributes.Token(word, pos=pos))
UnboundLocalError: local variable 'word' referenced before assignment
The text was updated successfully, but these errors were encountered:
Here is my traceback
The text was updated successfully, but these errors were encountered: