From fe9577d0ec51b7a5136d23885742780ca7f9ba8c Mon Sep 17 00:00:00 2001 From: Victor Chahuneau Date: Thu, 6 Sep 2012 15:08:55 +0100 Subject: [cdec.sa] Fix the list of matching training source sentence --- python/src/sa/rulefactory.pxi | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'python/src/sa/rulefactory.pxi') 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 -- cgit v1.2.3