diff options
-rw-r--r-- | phrase-extract/extract-ghkm/PhraseOrientation.cpp | 5 | ||||
-rw-r--r-- | phrase-extract/extract-main.cpp | 3 | ||||
-rw-r--r-- | phrase-extract/extract-ordering-main.cpp | 3 | ||||
-rw-r--r-- | phrase-extract/extract-rules-main.cpp | 3 |
4 files changed, 9 insertions, 5 deletions
diff --git a/phrase-extract/extract-ghkm/PhraseOrientation.cpp b/phrase-extract/extract-ghkm/PhraseOrientation.cpp index a96e5361c..f6abc9db8 100644 --- a/phrase-extract/extract-ghkm/PhraseOrientation.cpp +++ b/phrase-extract/extract-ghkm/PhraseOrientation.cpp @@ -20,6 +20,7 @@ #include "PhraseOrientation.h" #include <iostream> +#include <limits> #include <boost/assign/list_of.hpp> @@ -63,7 +64,7 @@ PhraseOrientation::PhraseOrientation(const std::vector<std::string> &source, for (int startF=0; startF<countF; ++startF) { for (int endF=startF; endF<countF; ++endF) { - int minE = 9999; + int minE = std::numeric_limits<int>::max(); int maxE = -1; for (int fi=startF; fi<=endF; ++fi) { for (size_t i=0; i<alignedToS[fi].size(); ++i) { @@ -86,7 +87,7 @@ PhraseOrientation::PhraseOrientation(const std::vector<std::string> &source, for (int startE=0; startE<countE; ++startE) { for (int endE=startE; endE<countE; ++endE) { - int minF = 9999; + int minF = std::numeric_limits<int>::max(); int maxF = -1; std::vector< int > usedF = alignedCountS; for (int ei=startE; ei<=endE; ++ei) { diff --git a/phrase-extract/extract-main.cpp b/phrase-extract/extract-main.cpp index 552dcb739..2f22d8aba 100644 --- a/phrase-extract/extract-main.cpp +++ b/phrase-extract/extract-main.cpp @@ -18,6 +18,7 @@ #include <map> #include <set> #include <vector> +#include <limits> #include "SentenceAlignment.h" #include "tables-core.h" @@ -373,7 +374,7 @@ void ExtractTask::extract(SentenceAlignment &sentence) (endE<countE && (relaxLimit || endE<startE+m_options.maxPhraseLength)); endE++) { - int minF = 9999; + int minF = std::numeric_limits<int>::max(); int maxF = -1; vector< int > usedF = sentence.alignedCountS; for(int ei=startE; ei<=endE; ei++) { diff --git a/phrase-extract/extract-ordering-main.cpp b/phrase-extract/extract-ordering-main.cpp index b418ba24d..753879877 100644 --- a/phrase-extract/extract-ordering-main.cpp +++ b/phrase-extract/extract-ordering-main.cpp @@ -18,6 +18,7 @@ #include <map> #include <set> #include <vector> +#include <limits> #include "SentenceAlignment.h" #include "tables-core.h" @@ -321,7 +322,7 @@ void ExtractTask::extract(SentenceAlignment &sentence) (endE<countE && (relaxLimit || endE<startE+m_options.maxPhraseLength)); endE++) { - int minF = 9999; + int minF = std::numeric_limits<int>::max(); int maxF = -1; vector< int > usedF = sentence.alignedCountS; for(int ei=startE; ei<=endE; ei++) { diff --git a/phrase-extract/extract-rules-main.cpp b/phrase-extract/extract-rules-main.cpp index 592946b0d..676c145e2 100644 --- a/phrase-extract/extract-rules-main.cpp +++ b/phrase-extract/extract-rules-main.cpp @@ -29,6 +29,7 @@ #include <sstream> #include <string> #include <vector> +#include <limits> #ifdef WIN32 // Include Visual Leak Detector @@ -407,7 +408,7 @@ void ExtractTask::extractRules() // find find aligned source words // first: find minimum and maximum source word - int minS = 9999; + int minS = std::numeric_limits<int>::max(); int maxS = -1; vector< int > usedS = m_sentence.alignedCountS; for(int ti=startT; ti<=endT; ti++) { |