From 13e7cb4fa9550774085234e041e442999630eb3e Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Wed, 3 Feb 2016 15:00:35 -0500 Subject: Declared old-style $name$ and $noun$ canonical Without this, they get mixed in by the spell checker with "name" and "noun." --- kgramstats.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'kgramstats.cpp') 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) freevar fv_emoticons {emoticons, "emoticons.txt"}; std::map canonical_form; + // Ensure the old-style freevars exist + canonical_form["$name$"] = "$name$"; + words.emplace("$name$", std::string("$name$")); + canonical_form["$noun$"] = "$noun$"; + words.emplace("$noun$", std::string("$noun$")); + AspellConfig* spell_config = new_aspell_config(); AspellCanHaveError* possible_err = new_aspell_speller(spell_config); if (aspell_error_number(possible_err) != 0) -- cgit 1.4.1