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
path: root/moses
diff options
context:
space:
mode:
authorzens <zens@1f5c12ca-751b-0410-a591-d2e778427230>2006-07-19 04:17:10 +0400
committerzens <zens@1f5c12ca-751b-0410-a591-d2e778427230>2006-07-19 04:17:10 +0400
commite7cc0767d92992bf32d47ce0652416765136f3b1 (patch)
treef6031b2be4e79d1039aeed1fa09b81e284428ede /moses
parent648bd1dfcdc337f15ddf88823515e0cbedf62bd4 (diff)
*** empty log message ***
git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@184 1f5c12ca-751b-0410-a591-d2e778427230
Diffstat (limited to 'moses')
-rw-r--r--moses/src/CreateTargetPhraseCollection.cpp22
-rw-r--r--moses/src/CreateTargetPhraseCollection.h16
2 files changed, 38 insertions, 0 deletions
diff --git a/moses/src/CreateTargetPhraseCollection.cpp b/moses/src/CreateTargetPhraseCollection.cpp
new file mode 100644
index 000000000..01d93fc19
--- /dev/null
+++ b/moses/src/CreateTargetPhraseCollection.cpp
@@ -0,0 +1,22 @@
+// $Id$
+#include "CreateTargetPhraseCollection.h"
+
+#include "PhraseDictionary.h"
+#include "Input.h"
+#include "Sentence.h"
+#include "WordsRange.h"
+TargetPhraseCollection const*
+CreateTargetPhraseCollection(Dictionary const* d,
+ InputType const* i,
+ const WordsRange& r)
+{
+ if(Sentence const * s=dynamic_cast<Sentence const*>(i)) {
+ Phrase src=s->GetSubString(r);
+ if(dynamic_cast<PhraseDictionary const*>(d))
+ return dynamic_cast<PhraseDictionary const*>(d)->FindEquivPhrase(src);
+ }
+
+ // todo: implementation for PhraseDictionaryTree and Confusion Nets
+
+ return 0;
+}
diff --git a/moses/src/CreateTargetPhraseCollection.h b/moses/src/CreateTargetPhraseCollection.h
new file mode 100644
index 000000000..3e6aafa24
--- /dev/null
+++ b/moses/src/CreateTargetPhraseCollection.h
@@ -0,0 +1,16 @@
+// $Id$
+#ifndef CREATETARGETPHRASECOLLECTION_H_
+#define CREATETARGETPHRASECOLLECTION_H_
+#include <list>
+#include "Dictionary.h"
+#include "TargetPhrase.h"
+
+class InputType;
+class WordsRange;
+typedef std::list<TargetPhrase> TargetPhraseCollection;
+
+TargetPhraseCollection const*
+CreateTargetPhraseCollection(Dictionary const*,
+ InputType const*,
+ const WordsRange&);
+#endif