diff options
author | Michael Denkowski <mdenkows@cs.cmu.edu> | 2014-02-24 23:18:47 -0800 |
---|---|---|
committer | Michael Denkowski <mdenkows@cs.cmu.edu> | 2014-02-24 23:18:47 -0800 |
commit | 9cf584746a55fd724de6af39f2fbe7bff1b79643 (patch) | |
tree | ac6aaac9899ca632f4e481609fc6999e9a077a4c /python/cdec/sa/bilex.pxi | |
parent | 3524a33c3f2612c643a020437356846895504407 (diff) |
CountExceptLM and CountExceptLex features for online grammar extraction.
Diffstat (limited to 'python/cdec/sa/bilex.pxi')
-rw-r--r-- | python/cdec/sa/bilex.pxi | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/python/cdec/sa/bilex.pxi b/python/cdec/sa/bilex.pxi index 44bc0ce6..73ba99c1 100644 --- a/python/cdec/sa/bilex.pxi +++ b/python/cdec/sa/bilex.pxi @@ -249,6 +249,14 @@ cdef class BiLex: fclose(f) + def contains_e_word(self, eword): + return (eword in self.eword2id) + + + def contains_f_word(self, fword): + return (fword in self.fword2id) + + def get_e_id(self, eword): if eword not in self.eword2id: e_id = len(self.id2eword) |