diff options
author | graehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-08-13 03:30:49 +0000 |
---|---|---|
committer | graehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-08-13 03:30:49 +0000 |
commit | 6ca64b5cf2d4c0c2698d4298e88dde274f766ac4 (patch) | |
tree | c37af6ea1ae5159b8bea55a94b120359ba9188c3 /decoder/apply_fsa_models.h | |
parent | e1458e933f41a95bb5f98aeffbc15242ef7752f1 (diff) |
named_enum, itoa, cdec replace --a-b=x with --a_b=x
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@536 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'decoder/apply_fsa_models.h')
-rwxr-xr-x | decoder/apply_fsa_models.h | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/decoder/apply_fsa_models.h b/decoder/apply_fsa_models.h index 5120fb4e..6561c70c 100755 --- a/decoder/apply_fsa_models.h +++ b/decoder/apply_fsa_models.h @@ -4,25 +4,36 @@ #include <string> #include <iostream> #include "feature_vector.h" +#include "named_enum.h" struct FsaFeatureFunction; struct Hypergraph; struct SentenceMetadata; struct HgCFG; + +#define FSA_BY(X,t) \ + X(t,BU_CUBE,) \ + X(t,BU_FULL,) \ + X(t,EARLEY,) \ + +#define FSA_BY_TYPE FsaBy + +DECLARE_NAMED_ENUM(FSA_BY) + struct ApplyFsaBy { - enum { - BU_CUBE, - BU_FULL, - EARLEY, - N_ALGORITHMS - }; +/*enum { + BU_CUBE, + BU_FULL, + EARLEY, + N_ALGORITHMS + };*/ int pop_limit; // only applies to BU_FULL so far bool IsBottomUp() const { return algorithm==BU_FULL || algorithm==BU_CUBE; } int BottomUpAlgorithm() const; - int algorithm; + FsaBy algorithm; std::string name() const; friend inline std::ostream &operator << (std::ostream &o,ApplyFsaBy const& c) { o << c.name(); @@ -30,7 +41,7 @@ struct ApplyFsaBy { o << "("<<c.pop_limit<<")"; return o; } - explicit ApplyFsaBy(int alg, int poplimit=200); + explicit ApplyFsaBy(FsaBy alg, int poplimit=200); ApplyFsaBy(std::string const& name, int poplimit=200); ApplyFsaBy(const ApplyFsaBy &o) : algorithm(o.algorithm) { } static std::string all_names(); // space separated |