summaryrefslogtreecommitdiff
path: root/decoder/apply_fsa_models.h
diff options
context:
space:
mode:
authorgraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-08-07 03:41:32 +0000
committergraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-08-07 03:41:32 +0000
commit5c40dcfe323dbf95a16a995588a77f393d42749c (patch)
tree025f1c5f0add6b134f4173c475b0a2321288fb14 /decoder/apply_fsa_models.h
parentaaac9f8ee73ba59b72609af9a78b167312a6dac7 (diff)
apply fsa models (so far only by bottom up) in cdec
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@487 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'decoder/apply_fsa_models.h')
-rwxr-xr-xdecoder/apply_fsa_models.h29
1 files changed, 28 insertions, 1 deletions
diff --git a/decoder/apply_fsa_models.h b/decoder/apply_fsa_models.h
index 0a8615b5..64ebab39 100755
--- a/decoder/apply_fsa_models.h
+++ b/decoder/apply_fsa_models.h
@@ -1,15 +1,42 @@
#ifndef _APPLY_FSA_MODELS_H_
#define _APPLY_FSA_MODELS_H_
-#include "ff_fsa_dynamic.h"
+#include <iostream>
+#include "feature_vector.h"
struct FsaFeatureFunction;
struct Hypergraph;
struct SentenceMetadata;
+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;
+ int algorithm;
+ std::string name() const;
+ friend inline std::ostream &operator << (std::ostream &o,ApplyFsaBy const& c) {
+ return o << c.name();
+ }
+ explicit ApplyFsaBy(int 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(const Hypergraph& 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);
#endif