diff options
author | Kenneth Heafield <github@kheafield.com> | 2011-10-24 20:53:13 +0400 |
---|---|---|
committer | Kenneth Heafield <github@kheafield.com> | 2011-10-24 20:53:51 +0400 |
commit | 4b7a09dad6c0f9e318be1aed0980b861f1679f2e (patch) | |
tree | 1e268326b345624607f002f6f02cd167d7acb969 /kenlm | |
parent | cb87f251b2575c53c70625d3cebd7e3e6dd28278 (diff) |
Fix Trie building with pruned bigrams. There was a Bad File descriptor error.
Diffstat (limited to 'kenlm')
-rw-r--r-- | kenlm/lm/search_trie.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kenlm/lm/search_trie.cc b/kenlm/lm/search_trie.cc index a3c14ef00..371c29639 100644 --- a/kenlm/lm/search_trie.cc +++ b/kenlm/lm/search_trie.cc @@ -491,7 +491,7 @@ template <class Quant, class Bhiksha> void BuildTrie(const std::string &file_pre util::scoped_FILE unigram_file; { std::string name(file_prefix + "unigrams"); - unigram_file.reset(OpenOrThrow(name.c_str(), "r")); + unigram_file.reset(OpenOrThrow(name.c_str(), "r+")); util::RemoveOrThrow(name.c_str()); } sri.ObtainBackoffs(counts.size(), unigram_file.get(), inputs); |