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
frompattern3.enimporttagfromnltk.corpusimportwordnetaswn# Annotate text tokens with POS tagsdefpos_tag_text(text):
defpenn_to_wn_tags(pos_tag):
ifpos_tag.startswith('J'):
returnwn.ADJelifpos_tag.startswith('V'):
returnwn.VERBelifpos_tag.startswith('N'):
returnwn.NOUNelifpos_tag.startswith('R'):
returnwn.ADVelse:
returnNonetagged_text=tag(text)
tagged_lower_text= [(word.lower(), penn_to_wn_tags(pos_tag))
forword, pos_tagintagged_text]
returntagged_lower_text
I got the error message:
File "/Anaconda3/lib/python3.6/site-packages/pattern3/text/tree.py", line 37
except:
^
IndentationError: expected an indented block
The text was updated successfully, but these errors were encountered:
When I run the code in python3,
I got the error message:
File "/Anaconda3/lib/python3.6/site-packages/pattern3/text/tree.py", line 37
except:
^
IndentationError: expected an indented block
The text was updated successfully, but these errors were encountered: