@@ -86,6 +86,10 @@ def parse_parser_results(text):
86
86
crexp = re .compile ('\s(\d*)\s(\d*)\s\-\>\s(\d*)\s(\d*), that is' )
87
87
matches = crexp .findall (line )
88
88
for src_i , src_pos , sink_i , sink_pos in matches :
89
+ # TODO: src_i and sink_i correspond to the sentences.
90
+ # this was built for single sentences, and thus ignores
91
+ # the sentence number. Should be fixed, but would require
92
+ # restructuring the entire output.
89
93
print "COREF MATCH" , src_i , sink_i
90
94
src = tmp ['words' ][int (src_pos )- 1 ][0 ]
91
95
sink = tmp ['words' ][int (sink_pos )- 1 ][0 ]
@@ -167,7 +171,10 @@ def _parse(self, text, verbose=True):
167
171
# clean up anything leftover
168
172
while True :
169
173
try :
170
- ch = self ._server .read_nonblocking (2000 , 1 )
174
+ # the second argument is a forced delay (in seconds)
175
+ # EVERY parse must incur.
176
+ # TODO make this as small as possible.
177
+ ch = self ._server .read_nonblocking (4000 , 0.3 )
171
178
except pexpect .TIMEOUT :
172
179
break
173
180
@@ -178,7 +185,7 @@ def _parse(self, text, verbose=True):
178
185
179
186
# anything longer than 5 seconds requires that you also
180
187
# increase timeout=5 in jsonrpc.py
181
- max_expected_time = min (6 , 3 + len (text ) / 20.0 )
188
+ max_expected_time = min (5 , 3 + len (text ) / 20.0 )
182
189
if verbose : print "Timeout" , max_expected_time
183
190
end_time = time .time () + max_expected_time
184
191
incoming = ""
0 commit comments