diff options
author | Patrick Simianer <simianer@cl.uni-heidelberg.de> | 2012-06-13 14:42:07 +0200 |
---|---|---|
committer | Patrick Simianer <simianer@cl.uni-heidelberg.de> | 2012-06-13 14:42:07 +0200 |
commit | dcba237fdda20cb32a5d9890c3beae790db446c2 (patch) | |
tree | b09846c7ed1ea3c0f13748ed13ce49efeca7fecc /python/src/decoder.pxd | |
parent | d86299e31deb81a836b1b2f2a356a6f4b28eda9e (diff) | |
parent | 34c2c129a376abfc79e76cf2fa1282b89ef605b6 (diff) |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'python/src/decoder.pxd')
-rw-r--r-- | python/src/decoder.pxd | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/python/src/decoder.pxd b/python/src/decoder.pxd new file mode 100644 index 00000000..ab858841 --- /dev/null +++ b/python/src/decoder.pxd @@ -0,0 +1,37 @@ +from libcpp.string cimport string +from libcpp.vector cimport vector +from hypergraph cimport Hypergraph +from utils cimport istream, weight_t + +cdef extern from "decoder/ff_register.h": + cdef void register_feature_functions() + +cdef extern from "decoder/decoder.h": + cdef cppclass SentenceMetadata: + pass + + cdef cppclass DecoderObserver: + DecoderObserver() + + cdef cppclass Decoder: + Decoder(int argc, char** argv) + Decoder(istream* config_file) + bint Decode(string input, DecoderObserver* observer) + + # access this to either *read* or *write* to the decoder's last + # weight vector (i.e., the weights of the finest past) + vector[weight_t]& CurrentWeightVector() + + void SetId(int id) + #const boost::program_options::variables_map& GetConf() const { return conf } + + # add grammar rules (currently only supported by SCFG decoders) + # that will be used on subsequent calls to Decode. rules should be in standard + # text format. This function does NOT read from a file. + void SetSupplementalGrammar(string grammar) + void SetSentenceGrammarFromString(string grammar_str) + +cdef extern from "observer.h": + cdef cppclass BasicObserver(DecoderObserver): + Hypergraph* hypergraph + BasicObserver() |