commit | 2441f7c09b781efd7393c7209103a2012796ffba | [log] [tgz] |
---|---|---|
author | „feldmueller“ <„feldmueller@posteo.de“> | Thu Nov 14 16:31:30 2024 +0100 |
committer | Marc Kupietz <kupietz@ids-mannheim.de> | Thu Nov 14 17:22:06 2024 +0100 |
tree | 17752dd136c76bad4bf55ebde97b7b838d117912 | |
parent | 442292368bedc801988a57d2c60d0369f7066e26 [diff] [blame] |
Fix calculation of total token count Change-Id: Ib8c2960f276107f7fe5dbf1699ff5b20f1315166
diff --git a/src/collocatordb.cc b/src/collocatordb.cc index 2660346..e2d37d5 100644 --- a/src/collocatordb.cc +++ b/src/collocatordb.cc
@@ -471,8 +471,7 @@ exit(1); } uint64_t i = 0; - while (!feof(fin)) { - fscanf(fin, "%s %lu", strbuf, &freq); + while (fscanf(fin, "%s %lu", strbuf, &freq) == 2) { _vocab.push_back({strbuf, freq}); total += freq; i++;