Repository: nltk/nltk
Issue category: Bug Report

Issue:
Missing procedure call in line 417
Line 417 of the file "nltk/app/wordnet_app.py" should look like this:

    elif synset.pos() == wn.ADJ or synset.pos() == wn.ADJ_SAT:

but instead looks like this:

    elif synset.pos() == wn.ADJ or synset.pos == wn.ADJ_SAT:

which will generate this error (complete with spelling mistake) :

    "Unhandles synset POS type: s"



Hints:
Thanks @drewvid, would you consider correcting both spelling errors in a PR?
Sure

Patch:
diff --git a/nltk/app/wordnet_app.py b/nltk/app/wordnet_app.py
index 48fe1e30f6..437eb0f755 100644
--- a/nltk/app/wordnet_app.py
+++ b/nltk/app/wordnet_app.py
@@ -414,7 +414,7 @@ def get_relations_data(word, synset):
                 ),
             ),
         )
-    elif synset.pos() == wn.ADJ or synset.pos == wn.ADJ_SAT:
+    elif synset.pos() == wn.ADJ or synset.pos() == wn.ADJ_SAT:
         return (
             (ANTONYM, "Antonym", lemma_property(word, synset, lambda l: l.antonyms())),
             (SIMILAR, "Similar to", synset.similar_tos()),
@@ -435,7 +435,7 @@ def get_relations_data(word, synset):
         )
         # Derived from adjective - not supported by corpus
     else:
-        raise TypeError("Unhandles synset POS type: " + str(synset.pos()))
+        raise TypeError("Unhandled synset POS type: " + str(synset.pos()))
 
 
 html_header = """


Test patch: