diff options
author | Kenneth Heafield <github@kheafield.com> | 2012-08-03 07:46:54 -0400 |
---|---|---|
committer | Kenneth Heafield <github@kheafield.com> | 2012-08-03 07:46:54 -0400 |
commit | be1ab0a8937f9c5668ea5e6c31b798e87672e55e (patch) | |
tree | a13aad60ab6cced213401bce6a38ac885ba171ba /python/src/decoder.pxd | |
parent | e5d6f4ae41009c26978ecd62668501af9762b0bc (diff) | |
parent | 9fe0219562e5db25171cce8776381600ff9a5649 (diff) |
Merge branch 'master' of github.com:redpony/cdec
Diffstat (limited to 'python/src/decoder.pxd')
-rw-r--r-- | python/src/decoder.pxd | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/python/src/decoder.pxd b/python/src/decoder.pxd index ab858841..a66166a2 100644 --- a/python/src/decoder.pxd +++ b/python/src/decoder.pxd @@ -1,10 +1,11 @@ from libcpp.string cimport string from libcpp.vector cimport vector from hypergraph cimport Hypergraph -from utils cimport istream, weight_t +from grammar cimport Grammar +from utils cimport * cdef extern from "decoder/ff_register.h": - cdef void register_feature_functions() + void register_feature_functions() cdef extern from "decoder/decoder.h": cdef cppclass SentenceMetadata: @@ -16,20 +17,18 @@ cdef extern from "decoder/decoder.h": cdef cppclass Decoder: Decoder(int argc, char** argv) Decoder(istream* config_file) - bint Decode(string input, DecoderObserver* observer) + bint Decode(string& inp, 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 } + # void SetId(int id) + variables_map& GetConf() # 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) + void AddSupplementalGrammarFromString(string& grammar_str) + void AddSupplementalGrammar(shared_ptr[Grammar] grammar) cdef extern from "observer.h": cdef cppclass BasicObserver(DecoderObserver): |