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:
authorHieu Hoang <hieu@hoang.co.uk>2013-07-30 18:04:37 +0400
committerHieu Hoang <hieu@hoang.co.uk>2013-07-30 18:04:37 +0400
commit77872f7521d65da38858a2b35ec7803437ec6208 (patch)
tree9bbcbe07611893daefe4be32227dfdbd7ed14b90 /phrase-extract/extract-main.cpp
parent1d40a604df65706a468857237d2c7e4852b14d57 (diff)
beautify
Diffstat (limited to 'phrase-extract/extract-main.cpp')
-rw-r--r--phrase-extract/extract-main.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/phrase-extract/extract-main.cpp b/phrase-extract/extract-main.cpp
index 53e4b804d..4804f83b8 100644
--- a/phrase-extract/extract-main.cpp
+++ b/phrase-extract/extract-main.cpp
@@ -78,7 +78,7 @@ bool isAligned (SentenceAlignment &, int, int);
int sentenceOffset = 0;
std::vector<std::string> Tokenize(const std::string& str,
- const std::string& delimiters = " \t");
+ const std::string& delimiters = " \t");
}
@@ -687,7 +687,7 @@ void ExtractTask::addPhrase( SentenceAlignment &sentence, int startE, int endE,
}
if (!checkPlaceholders(sentence, startE, endE, startF, endF)) {
- return;
+ return;
}
for(int fi=startF; fi<=endF; fi++) {
@@ -816,19 +816,19 @@ bool ExtractTask::checkPlaceholders (const SentenceAlignment &sentence, int star
for (size_t pos = startF; pos <= endF; ++pos) {
const string &word = sentence.source[pos];
if (isPlaceholder(word)) {
- if (sentence.alignedCountS[pos] != 1) {
- return false;
- }
+ if (sentence.alignedCountS[pos] != 1) {
+ return false;
+ }
}
}
for (size_t pos = startE; pos <= endE; ++pos) {
- const string &word = sentence.target[pos];
- if (isPlaceholder(word)) {
- if (sentence.alignedToT[pos].size() != 1) {
- return false;
- }
+ const string &word = sentence.target[pos];
+ if (isPlaceholder(word)) {
+ if (sentence.alignedToT[pos].size() != 1) {
+ return false;
}
+ }
}
return true;
@@ -837,10 +837,10 @@ bool ExtractTask::checkPlaceholders (const SentenceAlignment &sentence, int star
bool ExtractTask::isPlaceholder(const string &word)
{
for (size_t i = 0; i < m_options.placeholders.size(); ++i) {
- const string &placeholder = m_options.placeholders[i];
- if (word == placeholder) {
- return true;
- }
+ const string &placeholder = m_options.placeholders[i];
+ if (word == placeholder) {
+ return true;
+ }
}
return false;
}
@@ -848,7 +848,7 @@ bool ExtractTask::isPlaceholder(const string &word)
The separator can only be 1 character long. The default delimiters are space or tab
*/
std::vector<std::string> Tokenize(const std::string& str,
- const std::string& delimiters)
+ const std::string& delimiters)
{
std::vector<std::string> tokens;
// Skip delimiters at beginning.