about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2016-02-03 15:00:35 -0500
committerKelly Rauchenberger <fefferburbia@gmail.com>2016-02-03 15:00:35 -0500
commit13e7cb4fa9550774085234e041e442999630eb3e (patch)
tree93acb20b5ed22ccb21955fa529d6cccf0bb9737d
parentfd3c94ac13bbd4876766bfc83559d3404c31b963 (diff)
downloadrawr-ebooks-13e7cb4fa9550774085234e041e442999630eb3e.tar.gz
rawr-ebooks-13e7cb4fa9550774085234e041e442999630eb3e.tar.bz2
rawr-ebooks-13e7cb4fa9550774085234e041e442999630eb3e.zip
Declared old-style $name$ and $noun$ canonical
Without this, they get mixed in by the spell checker with "name" and "noun."
-rw-r--r--kgramstats.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/kgramstats.cpp b/kgramstats.cpp index 7d28c86..9358e80 100644 --- a/kgramstats.cpp +++ b/kgramstats.cpp
@@ -60,6 +60,12 @@ kgramstats::kgramstats(std::string corpus, int maxK)
60 freevar fv_emoticons {emoticons, "emoticons.txt"}; 60 freevar fv_emoticons {emoticons, "emoticons.txt"};
61 std::map<std::string, std::string> canonical_form; 61 std::map<std::string, std::string> canonical_form;
62 62
63 // Ensure the old-style freevars exist
64 canonical_form["$name$"] = "$name$";
65 words.emplace("$name$", std::string("$name$"));
66 canonical_form["$noun$"] = "$noun$";
67 words.emplace("$noun$", std::string("$noun$"));
68
63 AspellConfig* spell_config = new_aspell_config(); 69 AspellConfig* spell_config = new_aspell_config();
64 AspellCanHaveError* possible_err = new_aspell_speller(spell_config); 70 AspellCanHaveError* possible_err = new_aspell_speller(spell_config);
65 if (aspell_error_number(possible_err) != 0) 71 if (aspell_error_number(possible_err) != 0)