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 'lm/read_arpa.cc')
-rw-r--r--lm/read_arpa.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/lm/read_arpa.cc b/lm/read_arpa.cc
index be6565992..50d933c83 100644
--- a/lm/read_arpa.cc
+++ b/lm/read_arpa.cc
@@ -84,7 +84,7 @@ void ReadBackoff(util::FilePiece &in, Prob &/*weights*/) {
}
}
-void ReadBackoff(util::FilePiece &in, ProbBackoff &weights) {
+void ReadBackoff(util::FilePiece &in, float &backoff) {
// Always make zero negative.
// Negative zero means that no (n+1)-gram has this n-gram as context.
// Therefore the hypothesis state can be shorter. Of course, many n-grams
@@ -92,16 +92,16 @@ void ReadBackoff(util::FilePiece &in, ProbBackoff &weights) {
// back and set the backoff to positive zero in these cases.
switch (in.get()) {
case '\t':
- weights.backoff = in.ReadFloat();
- if (weights.backoff == ngram::kExtensionBackoff) weights.backoff = ngram::kNoExtensionBackoff;
+ backoff = in.ReadFloat();
+ if (backoff == ngram::kExtensionBackoff) backoff = ngram::kNoExtensionBackoff;
{
- int float_class = fpclassify(weights.backoff);
- UTIL_THROW_IF(float_class == FP_NAN || float_class == FP_INFINITE, FormatLoadException, "Bad backoff " << weights.backoff);
+ int float_class = fpclassify(backoff);
+ UTIL_THROW_IF(float_class == FP_NAN || float_class == FP_INFINITE, FormatLoadException, "Bad backoff " << backoff);
}
- UTIL_THROW_IF((in.get() != '\n'), FormatLoadException, "Expected newline after backoff");
+ UTIL_THROW_IF(in.get() != '\n', FormatLoadException, "Expected newline after backoff");
break;
case '\n':
- weights.backoff = ngram::kNoExtensionBackoff;
+ backoff = ngram::kNoExtensionBackoff;
break;
default:
UTIL_THROW(FormatLoadException, "Expected tab or newline for backoff");