Commits

Anonymous committed 4452bba

README update

  • Participants
  • Parent commits 3207767

Comments (0)

Files changed (2)

     corenlp = StanfordCoreNLP() 
     corenlp.parse("Parse an imperative sentence, damnit!")
 
-I also added a function called **parse_imperative** that introduces a dummy pronoun to overcome the problems that dependency parsers have with imperative statements.
+I added a function called `parse_imperative` that introduces a dummy pronoun to overcome the problems that dependency parsers have with imperative statements.
 
     corenlp.parse("stop smoking")
     >> [{"text": "stop smoking", "tuples": [["nn", "smoking", "stop"]], "words": [["stop", {"NamedEntityTag": "O", "CharacterOffsetEnd": "4", "Lemma": "stop", "PartOfSpeech": "NN", "CharacterOffsetBegin": "0"}], ["smoking", {"NamedEntityTag": "O", "CharacterOffsetEnd": "12", "Lemma": "smoking", "PartOfSpeech": "NN", "CharacterOffsetBegin": "5"}]]}]
     corenlp.parse_imperative("stop smoking")
     >> [{"text": "stop smoking", "tuples": [["xcomp", "stop", "smoking"]], "words": [["stop", {"NamedEntityTag": "O", "CharacterOffsetEnd": "8", "Lemma": "stop", "PartOfSpeech": "VBP", "CharacterOffsetBegin": "4"}], ["smoking", {"NamedEntityTag": "O", "CharacterOffsetEnd": "16", "Lemma": "smoke", "PartOfSpeech": "VBG", "CharacterOffsetBegin": "9"}]]}]
 
+Only with the dummy pronoun does the parser correctly identify the first word, *stop*, to be a verb.
 
 <!--
 ## Adding WordNet
 
 #  TODO
 
+  - Adjust Char Offsets for `parse_imperative` to account for dummy pronoun.
   - Parse and resolve coreferences
   - Mutex on parser
-  - have pyexpect eat up dead chars after timeout (before next parse after a timeout)
 
         It returns a Python data-structure, while the parse()
         function returns a JSON object
         """
+        # clean up anything leftover
         while True:
             try:
                 ch = self._server.read_nonblocking (2000, 1)
             except pexpect.TIMEOUT:
                 break
 
-        # clean up anything leftover
-
         self._server.sendline(text)
         # How much time should we give the parser to parse it?
         # the idea here is that you increase the timeout as a