diff options
author | Kenneth Heafield <github@kheafield.com> | 2011-10-19 20:52:37 +0400 |
---|---|---|
committer | Kenneth Heafield <github@kheafield.com> | 2011-10-19 20:52:37 +0400 |
commit | ca773431c3b5123603a247bc46623fb048ed4998 (patch) | |
tree | 88c4c17baa98161f9fd7b0849d12f0b77d3082e5 /kenlm | |
parent | 81dbd6574efd37a4233412ca50ac76398e74d946 (diff) |
Reduce user e-mails related to IRSTLM formats
Diffstat (limited to 'kenlm')
-rw-r--r-- | kenlm/lm/read_arpa.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kenlm/lm/read_arpa.cc b/kenlm/lm/read_arpa.cc index 455bc4ba8..dce73f771 100644 --- a/kenlm/lm/read_arpa.cc +++ b/kenlm/lm/read_arpa.cc @@ -38,6 +38,8 @@ void ReadARPACounts(util::FilePiece &in, std::vector<uint64_t> &number) { } if (static_cast<size_t>(line.size()) >= strlen(kBinaryMagic) && StringPiece(line.data(), strlen(kBinaryMagic)) == kBinaryMagic) UTIL_THROW(FormatLoadException, "This looks like a binary file but got sent to the ARPA parser. Did you compress the binary file or pass a binary file where only ARPA files are accepted?"); + UTIL_THROW_IF(line.size() >= 4 && StringPiece(line.data(), 4) == "blmt", FormatLoadException, "This looks like an IRSTLM binary file. Did you forget to pass --text yes to compile-lm?"); + UTIL_THROW_IF(line == "iARPA", FormatLoadException, "This looks like an IRSTLM iARPA file. You need an ARPA file. Run\n compile-lm --text yes " << in.FileName() << " " << in.FileName() << ".arpa\nfirst."); UTIL_THROW(FormatLoadException, "first non-empty line was \"" << line << "\" not \\data\\."); } while (!IsEntirelyWhiteSpace(line = in.ReadLine())) { |