From b939bff222736e87fa234c2835511cc29fce644f Mon Sep 17 00:00:00 2001 From: Victor Chahuneau Date: Wed, 5 Sep 2012 19:17:29 +0100 Subject: Revert to the "old style" pair count... + API naming fixes + Multiple feature definition files can be passed to the extractor --- python/src/sa/rulefactory.pxi | 7 ++++--- 1 file changed, 4 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 54471ccd..fb496aff 100644 --- a/python/src/sa/rulefactory.pxi +++ b/python/src/sa/rulefactory.pxi @@ -1098,12 +1098,13 @@ cdef class HieroCachingRuleFactory: fphrases[f][e][als].append(loc) for f, elist in fphrases.iteritems(): for e, alslist in elist.iteritems(): - alignment = max(alslist.iteritems(), key=lambda x: len(x[1]))[0] + alignment, max_locs = max(alslist.iteritems(), key=lambda x: len(x[1])) locs = tuple(itertools.chain(alslist.itervalues())) - count = len(locs) + # count = len(locs) # Should be? + count = len(max_locs) # Was scores = self.scorer.score(FeatureContext( f, e, count, fcount[f], num_samples, - (k,i), locs, fwords + (k, i), locs, fwords )) yield Rule(self.category, f, e, scores, alignment) -- cgit v1.2.3