summaryrefslogtreecommitdiff
path: root/python/src/sa/rulefactory.pxi
diff options
context:
space:
mode:
authorVictor Chahuneau <vchahune@cs.cmu.edu>2012-12-23 23:07:31 +0100
committerVictor Chahuneau <vchahune@cs.cmu.edu>2012-12-23 23:07:31 +0100
commite66ce4f37f98af2e23c800c7dc6fd8fc83d07353 (patch)
tree9972e8ed1adeb56ede19b2c6020e92a5116860e4 /python/src/sa/rulefactory.pxi
parent597d89c11db53e91bc011eab70fd613bbe6453e8 (diff)
Memory mapping for IntList/FloatList
+ vocabulary class for DataArray & BiLex
Diffstat (limited to 'python/src/sa/rulefactory.pxi')
-rw-r--r--python/src/sa/rulefactory.pxi8
1 files changed, 4 insertions, 4 deletions
diff --git a/python/src/sa/rulefactory.pxi b/python/src/sa/rulefactory.pxi
index 5006a838..45b16656 100644
--- a/python/src/sa/rulefactory.pxi
+++ b/python/src/sa/rulefactory.pxi
@@ -389,10 +389,10 @@ cdef class HieroCachingRuleFactory:
cdef int word_id, new_word_id, N
cdef IntList idmap
- N = len(darray.id2word)
+ N = len(darray.voc)
idmap = IntList(initial_len=N)
for word_id from 0 <= word_id < N:
- new_word_id = sym_fromstring(darray.id2word[word_id], True)
+ new_word_id = sym_fromstring(darray.voc.id2word[word_id], True)
idmap.arr[word_id] = new_word_id
return idmap
@@ -406,7 +406,7 @@ cdef class HieroCachingRuleFactory:
arity = arity + 1
new_id = sym_setindex(self.category, arity)
else:
- new_id = sym_fromstring(self.fda.id2word[word_id], True)
+ new_id = sym_fromstring(self.fda.voc.id2word[word_id], True)
result = result + (new_id,)
return Phrase(result)
@@ -421,7 +421,7 @@ cdef class HieroCachingRuleFactory:
arity = arity + 1
new_id = sym_setindex(self.category, arity)
else:
- new_id = sym_fromstring(self.fda.id2word[word_id], True)
+ new_id = sym_fromstring(self.fda.voc.id2word[word_id], True)
result = result + (new_id,)
patterns.append(Phrase(result))
patterns.append(Phrase(result + (sym_setindex(self.category, 1),)))