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 | b939bff222736e87fa234c2835511cc29fce644f (patch) | |
tree | 869aeabb86e5ce4ab4f9bdb7924f3c6233e1a051 /python/src/sa/rulefactory.pxi | |
parent | c6b35eff2537f0b07ceb9aca499e8f76b3d33710 (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) |