summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Denkowski <michael.j.denkowski@gmail.com>2012-12-23 21:58:24 -0500
committerMichael Denkowski <michael.j.denkowski@gmail.com>2012-12-23 21:58:24 -0500
commitcfb1ea5f6b77e87dc28a20116a58f04823501f53 (patch)
treef9c96dc143ac7dc0337157d1a7a2c2b6bba35413
parentce0e5fd27ba4ca992ddaaee9bf5a8f0667386be1 (diff)
debugging
-rwxr-xr-xpython/src/sa/online_extractor.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/python/src/sa/online_extractor.py b/python/src/sa/online_extractor.py
index 90087f30..8aae3959 100755
--- a/python/src/sa/online_extractor.py
+++ b/python/src/sa/online_extractor.py
@@ -111,7 +111,7 @@ class OnlineGrammarExtractor:
# f_ i and j are current, e_ i and j are previous
def extract(f_i, f_j, e_i, e_j, wc, links, nt, nt_open):
# Phrase extraction limits
- if wc > self.max_length or (f_j + 1) > f_len or \
+ if wc + len(nt) > self.max_length or (f_j + 1) > f_len or \
(f_j - f_i) + 1 > self.max_size:
return
# Unaligned word
@@ -327,6 +327,7 @@ def main(argv):
extractor = OnlineGrammarExtractor()
for line in sys.stdin:
+ print >> sys.stderr, line.strip()
f_words, e_words, a_str = (x.split() for x in line.split('|||'))
alignment = sorted(tuple(int(y) for y in x.split('-')) for x in a_str)
extractor.add_instance(f_words, e_words, alignment)