summaryrefslogtreecommitdiff
path: root/decoder/ff_charset.h
diff options
context:
space:
mode:
authorChris Dyer <cdyer@cs.cmu.edu>2010-12-23 20:22:45 -0600
committerChris Dyer <cdyer@cs.cmu.edu>2010-12-23 20:22:45 -0600
commit6b4b4f19f44e051e5f62bcb1243c3d199d537cc6 (patch)
treec3dcea05a77c84424a804b12291f8b89a591a603 /decoder/ff_charset.h
parent1ffcac39647bdc13e6f6ef73ade6b88d59a08101 (diff)
non-latin character detector
Diffstat (limited to 'decoder/ff_charset.h')
-rw-r--r--decoder/ff_charset.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/decoder/ff_charset.h b/decoder/ff_charset.h
new file mode 100644
index 00000000..b1ad537e
--- /dev/null
+++ b/decoder/ff_charset.h
@@ -0,0 +1,26 @@
+#ifndef _FFCHARSET_H_
+#define _FFCHARSET_H_
+
+#include <string>
+#include <map>
+#include "ff.h"
+#include "hg.h"
+
+class SentenceMetadata;
+
+class NonLatinCount : public FeatureFunction {
+ public:
+ NonLatinCount(const std::string& param);
+ protected:
+ virtual void TraversalFeaturesImpl(const SentenceMetadata& smeta,
+ const Hypergraph::Edge& edge,
+ const std::vector<const void*>& ant_contexts,
+ FeatureVector* features,
+ FeatureVector* estimated_features,
+ void* context) const;
+ private:
+ mutable std::map<WordID, bool> is_non_latin_;
+ const int fid_;
+};
+
+#endif