diff options
author | Victor Chahuneau <vchahune@cs.cmu.edu> | 2012-09-05 19:17:29 +0100 |
---|---|---|
committer | Victor Chahuneau <vchahune@cs.cmu.edu> | 2012-09-05 19:17:29 +0100 |
commit | 2928b86c3972d705c76e04499f148854aa8588a8 (patch) | |
tree | 2686ea420d4907e5967844de142cd744baa5ff6d /python/src/sa/rulefactory.pxi | |
parent | ee1cc47a751bff864d1f365d3bbf3e1c7a73f469 (diff) |
Revert to the "old style" pair count...
+ API naming fixes
+ Multiple feature definition files can be passed to the extractor
Diffstat (limited to 'python/src/sa/rulefactory.pxi')
-rw-r--r-- | python/src/sa/rulefactory.pxi | 7 |
1 files changed, 4 insertions, 3 deletions
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) |