diff options
Diffstat (limited to 'kgramstats.cpp')
-rw-r--r-- | kgramstats.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/kgramstats.cpp b/kgramstats.cpp index 4daf474..e6048d9 100644 --- a/kgramstats.cpp +++ b/kgramstats.cpp | |||
@@ -61,6 +61,12 @@ kgramstats::kgramstats(std::string corpus, int maxK) | |||
61 | freevar fv_emoticons {emoticons, "emoticons.txt"}; | 61 | freevar fv_emoticons {emoticons, "emoticons.txt"}; |
62 | std::map<std::string, std::string> canonical_form; | 62 | std::map<std::string, std::string> canonical_form; |
63 | 63 | ||
64 | // Ensure the old-style freevars exist | ||
65 | canonical_form["$name$"] = "$name$"; | ||
66 | words.emplace("$name$", std::string("$name$")); | ||
67 | canonical_form["$noun$"] = "$noun$"; | ||
68 | words.emplace("$noun$", std::string("$noun$")); | ||
69 | |||
64 | AspellConfig* spell_config = new_aspell_config(); | 70 | AspellConfig* spell_config = new_aspell_config(); |
65 | AspellCanHaveError* possible_err = new_aspell_speller(spell_config); | 71 | AspellCanHaveError* possible_err = new_aspell_speller(spell_config); |
66 | if (aspell_error_number(possible_err) != 0) | 72 | if (aspell_error_number(possible_err) != 0) |