Skip to content

Commit

Permalink
Support for different loading methods
Browse files Browse the repository at this point in the history
  • Loading branch information
kpu committed Mar 29, 2016
1 parent 277403c commit 97482fb
Show file tree
Hide file tree
Showing 4 changed files with 938 additions and 318 deletions.
17 changes: 17 additions & 0 deletions python/_kenlm.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,22 @@ cdef extern from "lm/virtual_interface.hh" namespace "lm::base":
float BaseScore(void *in_state, WordIndex new_word, void *out_state)
FullScoreReturn BaseFullScore(void *in_state, WordIndex new_word, void *out_state)

cdef extern from "util/mmap.hh" namespace "util":
cdef enum LoadMethod:
LAZY
POPULATE_OR_LAZY
POPULATE_OR_READ
READ
PARALLEL_READ

cdef extern from "lm/config.hh" namespace "lm::ngram":
cdef cppclass Config:
Config()
float probing_multiplier
LoadMethod load_method

cdef extern from "lm/model.hh" namespace "lm::ngram":
cdef Model *LoadVirtual(char *, Config &config) except +
#default constructor
cdef Model *LoadVirtual(char *) except +

Loading

0 comments on commit 97482fb

Please sign in to comment.