Skip to content

IndentationError: expected an indented block #40

Description

@anxin16

When I run the code in python3,

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions