dustin smith  committed 3e3938f

comments and readme update

  • Participants
  • Parent commits 668289e
  • Branches master
  • Tags v1.0

Comments (0)

Files changed (2)

 Assuming you are running on port 8080, the code in `` shows an example parse: 
     import jsonrpc
+    from simplejson import loads
     server = jsonrpc.ServerProxy(jsonrpc.JsonRpc20(),
             jsonrpc.TransportTcpIp(addr=("", 8080)))
-    result = server.parse("hello world")
+    result = loads(server.parse("hello world"))
     print "Result", result
 Produces a list with a parsed dictionary for each sentence:
     Result [{'text': 'hello world', 
     return word.count("-") == 0 and word or word[0:word.rindex("-")]
 def parse_parser_results(text):
+    """ This is the nasty bit of code to interact with the command-line
+    interface of the CoreNLP tools.  Takes a string of the parser results
+    and then returns a Python list of dictionaries, one for each parsed
+    sentence.
+    """
     state = 0
     tmp = {}
     results = []
     return results
 class StanfordCoreNLP(object):
+    """ 
+    Command-line interaction with Stanford's CoreNLP java utilities.
+    Can be run as a JSON-RPC server or imported as a module.
+    """
     def __init__(self):	
         Checks the location of the jar files.
         This is a hacky way to deal with imperative statements.
-        It an imperative, adds a personal pronoun, parses it,
+        Takes an imperative, adds a personal pronoun, parses it,
         and then removes it in the resulting parse.
         e.g. "open the door" gets parsed as "you open the door"