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:
Diffstat (limited to 'scripts/training/phrase-extract/HoleCollection.cpp')
-rw-r--r--scripts/training/phrase-extract/HoleCollection.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/scripts/training/phrase-extract/HoleCollection.cpp b/scripts/training/phrase-extract/HoleCollection.cpp
new file mode 100644
index 000000000..e675eceb0
--- /dev/null
+++ b/scripts/training/phrase-extract/HoleCollection.cpp
@@ -0,0 +1,28 @@
+/*
+ * HoleCollection.cpp
+ * extract
+ *
+ * Created by Hieu Hoang on 19/01/2010.
+ * Copyright 2010 __MyCompanyName__. All rights reserved.
+ *
+ */
+#include <algorithm>
+#include "HoleCollection.h"
+
+using namespace std;
+
+void HoleCollection::SortSourceHoles()
+{
+ assert(m_sortedSourceHoles.size() == 0);
+
+ // add
+ HoleList::iterator iter;
+ for (iter = m_holes.begin(); iter != m_holes.end(); ++iter)
+ {
+ Hole &currHole = *iter;
+ m_sortedSourceHoles.push_back(&currHole);
+ }
+
+ // sort
+ std::sort(m_sortedSourceHoles.begin(), m_sortedSourceHoles.end(), HoleSourceOrderer());
+}