diff options
author | Victor Chahuneau <vchahune@cs.cmu.edu> | 2012-09-03 10:50:07 -0400 |
---|---|---|
committer | Victor Chahuneau <vchahune@cs.cmu.edu> | 2012-09-03 10:50:07 -0400 |
commit | 9d412216579967822088b6439889c08d5354dd09 (patch) | |
tree | 168faa0dfced815a08b541cff6c7103191b34ca5 /python/src/sa/rulefactory.pxi | |
parent | a7686cbe3a587081f14b3c8c228f260fbcdffba5 (diff) |
Support Python 2.6
Diffstat (limited to 'python/src/sa/rulefactory.pxi')
-rw-r--r-- | python/src/sa/rulefactory.pxi | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/python/src/sa/rulefactory.pxi b/python/src/sa/rulefactory.pxi index 34a002c5..afd83785 100644 --- a/python/src/sa/rulefactory.pxi +++ b/python/src/sa/rulefactory.pxi @@ -8,7 +8,7 @@ from libc.stdlib cimport malloc, realloc, free from libc.string cimport memset, memcpy from libc.math cimport fmod, ceil, floor, log -from collections import defaultdict, Counter +from collections import defaultdict cdef int PRECOMPUTE = 0 cdef int MERGE = 1 @@ -1078,8 +1078,8 @@ cdef class HieroCachingRuleFactory: extract_stop = monitor_cpu() self.extract_time = self.extract_time + extract_stop - extract_start if len(extracts) > 0: - fcount = Counter() - fphrases = defaultdict(lambda: defaultdict(Counter)) + fcount = defaultdict(int) + fphrases = defaultdict(lambda: defaultdict(lambda: defaultdict(int))) for f, e, count, als in extracts: fcount[f] += count fphrases[f][e][als] += count |