Skip to content

Commit

Permalink
Fix the bug related to chart.py shown in CI server.
Browse files Browse the repository at this point in the history
  • Loading branch information
longdt219 committed Mar 9, 2015
1 parent d7d7b58 commit 7d12d2a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions nltk/parse/chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -1313,7 +1313,7 @@ def chart_parse(self, tokens, trace=None):
# Width, for printing trace edges.
trace_edge_width = self._trace_chart_width // (chart.num_leaves() + 1)
if trace: print(chart.pretty_format_leaves(trace_edge_width))

if self._use_agenda:
# Use an agenda-based algorithm.
for axiom in self._axioms:
Expand Down Expand Up @@ -1628,8 +1628,9 @@ def demo(choice=None,
print()
cp = ChartParser(grammar, strategies[strategy][1], trace=trace)
t = time.time()
parses = cp.parse_all(tokens)
chart = cp.chart_parse(tokens)
parses = list(chart.parses(grammar.start()))

times[strategies[strategy][0]] = time.time()-t
print("Nr edges in chart:", len(chart.edges()))
if numparses:
Expand Down

0 comments on commit 7d12d2a

Please sign in to comment.