From 9d412216579967822088b6439889c08d5354dd09 Mon Sep 17 00:00:00 2001 From: Victor Chahuneau Date: Mon, 3 Sep 2012 10:50:07 -0400 Subject: Support Python 2.6 --- python/src/sa/rulefactory.pxi | 6 +++--- 1 file changed, 3 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 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 -- cgit v1.2.3