diff options
author | Paul Baltescu <pauldb89@gmail.com> | 2013-11-25 23:24:42 +0000 |
---|---|---|
committer | Paul Baltescu <pauldb89@gmail.com> | 2013-11-25 23:24:42 +0000 |
commit | 2b95390f08d9f556e6207ecff03b4b0fd5ede993 (patch) | |
tree | 7a96e837a3e28cfc8258a3c5293ac333d7c3e29e /decoder/apply_fsa_models.h | |
parent | 467ef6ce78cfe7341a696ebf0948e377be619ae5 (diff) | |
parent | 62a2526e69eb1570bf349763fc8bb65179337918 (diff) |
Merge branch 'master' of https://github.com/redpony/cdec
Diffstat (limited to 'decoder/apply_fsa_models.h')
-rw-r--r-- | decoder/apply_fsa_models.h | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/decoder/apply_fsa_models.h b/decoder/apply_fsa_models.h deleted file mode 100644 index 6561c70c..00000000 --- a/decoder/apply_fsa_models.h +++ /dev/null @@ -1,65 +0,0 @@ -#ifndef _APPLY_FSA_MODELS_H_ -#define _APPLY_FSA_MODELS_H_ - -#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 - };*/ - int pop_limit; // only applies to BU_FULL so far - bool IsBottomUp() const { - return algorithm==BU_FULL || algorithm==BU_CUBE; - } - int BottomUpAlgorithm() const; - FsaBy algorithm; - std::string name() const; - friend inline std::ostream &operator << (std::ostream &o,ApplyFsaBy const& c) { - o << c.name(); - if (c.algorithm==BU_CUBE) - o << "("<<c.pop_limit<<")"; - return o; - } - 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 -}; - -void ApplyFsaModels(HgCFG &hg_or_cfg_in, - const SentenceMetadata& smeta, - const FsaFeatureFunction& fsa, - DenseWeightVector const& weights, // pre: in is weighted by these (except with fsa featval=0 before this) - ApplyFsaBy const& cfg, - Hypergraph* out); - -void ApplyFsaModels(Hypergraph const& ih, - const SentenceMetadata& smeta, - const FsaFeatureFunction& fsa, - DenseWeightVector const& weights, // pre: in is weighted by these (except with fsa featval=0 before this) - ApplyFsaBy const& cfg, - Hypergraph* out); - - -#endif |