Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatous Machacek <machacekmatous@gmail.com>2012-03-24 19:07:47 +0400
committerMatous Machacek <machacekmatous@gmail.com>2012-03-24 19:07:47 +0400
commit1665a23fe18a07f9f0dd26de627411be9343eb73 (patch)
treec44d7cb122cfba53be2a44583e3e9abfbc195ff7 /mert/SemposOverlapping.h
parentac5ba83ec873491e72c406679aa386fd8924dabf (diff)
Added posibility to weight words in sempos
Diffstat (limited to 'mert/SemposOverlapping.h')
-rw-r--r--mert/SemposOverlapping.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/mert/SemposOverlapping.h b/mert/SemposOverlapping.h
index c5c36c851..e16ffe7bb 100644
--- a/mert/SemposOverlapping.h
+++ b/mert/SemposOverlapping.h
@@ -7,6 +7,8 @@
#include <utility>
#include <vector>
+class SemposScorer;
+
// TODO: need comments about this number.
const int kMaxNOC = 50;
@@ -32,7 +34,7 @@ public:
class SemposOverlappingFactory {
public:
- static SemposOverlapping* GetOverlapping(const std::string& str);
+ static SemposOverlapping* GetOverlapping(const std::string& str, const SemposScorer* sempos);
// dependency injection for unit testing.
static void SetOverlapping(SemposOverlapping* ovr);
@@ -51,7 +53,7 @@ class SemposOverlappingFactory {
class CapMicroOverlapping : public SemposOverlapping
{
public:
- CapMicroOverlapping() {}
+ CapMicroOverlapping(const SemposScorer* sempos) : semposScorer(sempos) {}
~CapMicroOverlapping() {}
virtual std::vector<int> prepareStats(const sentence_t& cand, const sentence_t& ref);
@@ -62,6 +64,7 @@ public:
// no copying allowed.
CapMicroOverlapping(const CapMicroOverlapping&);
CapMicroOverlapping& operator=(const CapMicroOverlapping&);
+ const SemposScorer* semposScorer;
};
/**
@@ -70,7 +73,7 @@ public:
class CapMacroOverlapping : public SemposOverlapping
{
public:
- CapMacroOverlapping() {}
+ CapMacroOverlapping(const SemposScorer* sempos) : semposScorer(sempos) {}
~CapMacroOverlapping() {}
virtual std::vector<int> prepareStats(const sentence_t& cand, const sentence_t& ref);
@@ -81,6 +84,7 @@ public:
// no copying allowed.
CapMacroOverlapping(const CapMacroOverlapping&);
CapMacroOverlapping& operator=(const CapMacroOverlapping&);
+ const SemposScorer* semposScorer;
};
#endif // MERT_SEMPOSOVERLAPPING_H_