summaryrefslogtreecommitdiff
path: root/python/src/sa/rulefactory.pxi
diff options
context:
space:
mode:
authorVictor Chahuneau <vchahune@cs.cmu.edu>2012-09-06 15:08:55 +0100
committerVictor Chahuneau <vchahune@cs.cmu.edu>2012-09-06 15:08:55 +0100
commitfe9577d0ec51b7a5136d23885742780ca7f9ba8c (patch)
treebed1636280e2efc3a56b2cfaf7d5529d95424799 /python/src/sa/rulefactory.pxi
parentaf8b109ad49222bc56527e5e75b8267134233bd4 (diff)
[cdec.sa] Fix the list of matching training source sentence
Diffstat (limited to 'python/src/sa/rulefactory.pxi')
-rw-r--r--python/src/sa/rulefactory.pxi5
1 files changed, 2 insertions, 3 deletions
diff --git a/python/src/sa/rulefactory.pxi b/python/src/sa/rulefactory.pxi
index 233654e9..3973554c 100644
--- a/python/src/sa/rulefactory.pxi
+++ b/python/src/sa/rulefactory.pxi
@@ -1101,9 +1101,8 @@ cdef class HieroCachingRuleFactory:
for f, elist in fphrases.iteritems():
for e, alslist in elist.iteritems():
alignment, max_locs = max(alslist.iteritems(), key=lambda x: len(x[1]))
- locs = tuple(itertools.chain(alslist.itervalues()))
- # count = len(locs) # Should be?
- count = len(max_locs) # Was
+ locs = tuple(itertools.chain.from_iterable(alslist.itervalues()))
+ count = len(locs)
scores = self.scorer.score(FeatureContext(
f, e, count, fcount[f], num_samples,
(k,i+spanlen), locs, fwords, self.fda, self.eda