diff options
author | Victor Chahuneau <vchahune@cs.cmu.edu> | 2012-07-21 01:22:53 -0400 |
---|---|---|
committer | Victor Chahuneau <vchahune@cs.cmu.edu> | 2012-07-21 01:22:53 -0400 |
commit | 06f90d83a1feafad301d365a4a437e44f68be45b (patch) | |
tree | 24128de1cb5a4767151f9380c46104a26121535d /python/src/decoder.pxd | |
parent | c4c9c2febd5af552ecddc215758e32b88013fbc7 (diff) |
[python] Support for grammars
- Translation rules can now be create programatically
- Grammars = list of translation rules can be used for translation
- Feature expectations on the hypergraph (inside_outside)
Diffstat (limited to 'python/src/decoder.pxd')
-rw-r--r-- | python/src/decoder.pxd | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/python/src/decoder.pxd b/python/src/decoder.pxd index 660bcb39..d2065579 100644 --- a/python/src/decoder.pxd +++ b/python/src/decoder.pxd @@ -1,7 +1,8 @@ from libcpp.string cimport string from libcpp.vector cimport vector from hypergraph cimport Hypergraph -from utils cimport istream, weight_t, variables_map +from grammar cimport Grammar +from utils cimport * cdef extern from "decoder/ff_register.h": void register_feature_functions() @@ -28,8 +29,8 @@ cdef extern from "decoder/decoder.h": # 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): |