summaryrefslogtreecommitdiff
path: root/python/src/sa/rulefactory.pxi
diff options
context:
space:
mode:
authorVictor Chahuneau <vchahune@cs.cmu.edu>2012-09-03 10:50:07 -0400
committerVictor Chahuneau <vchahune@cs.cmu.edu>2012-09-03 10:50:07 -0400
commit996d16a433c080ee23d265ee7454bf59c2427399 (patch)
tree786b956155c599d692a61f8b4ba08c8f35c8323a /python/src/sa/rulefactory.pxi
parentd2074ba8dd149ed943e06651d58672aec7464002 (diff)
Support Python 2.6
Diffstat (limited to 'python/src/sa/rulefactory.pxi')
-rw-r--r--python/src/sa/rulefactory.pxi6
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