diff options
author | Chris Dyer <cdyer@cs.cmu.edu> | 2012-07-25 23:40:06 -0400 |
---|---|---|
committer | Chris Dyer <cdyer@cs.cmu.edu> | 2012-07-25 23:40:06 -0400 |
commit | 717136fff09cde560d0bb0fea93a3527708d5d15 (patch) | |
tree | 53d5b4587d82dd5c10cb45a0e33aabd2cc0b166e /sa-extract/csuf.pyx | |
parent | eeef93717fed2901f6fcd2e3fd11118e0e309af7 (diff) |
maybe faster
Diffstat (limited to 'sa-extract/csuf.pyx')
-rw-r--r-- | sa-extract/csuf.pyx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sa-extract/csuf.pyx b/sa-extract/csuf.pyx index 64c44788..2f0b1383 100644 --- a/sa-extract/csuf.pyx +++ b/sa-extract/csuf.pyx @@ -223,7 +223,7 @@ cdef class SuffixArray: f.close() - cdef __search_high(self, word_id, offset, low, high): + cdef int __search_high(self, int word_id, int offset, int low, int high): cdef int midpoint if low >= high: @@ -235,7 +235,7 @@ cdef class SuffixArray: return self.__search_high(word_id, offset, low, midpoint) - cdef __search_low(self, int word_id, int offset, int low, int high): + cdef int __search_low(self, int word_id, int offset, int low, int high): cdef int midpoint if low >= high: @@ -269,7 +269,8 @@ cdef class SuffixArray: return self.__lookup_helper(word_id, offset, midpoint+1, high) - def lookup(self, word, offset, int low, int high): + def lookup(self, word, int offset, int low, int high): + cdef int wordid if low == -1: low = 0 if high == -1: |