diff options
-rw-r--r-- | emoticons.txt | 6 | ||||
-rw-r--r-- | kgramstats.cpp | 6 |
2 files changed, 11 insertions, 1 deletions
diff --git a/emoticons.txt b/emoticons.txt index 15382b4..dd3742d 100644 --- a/emoticons.txt +++ b/emoticons.txt | |||
@@ -10,4 +10,8 @@ o_o | |||
10 | X_X | 10 | X_X |
11 | x_x | 11 | x_x |
12 | ^_^ | 12 | ^_^ |
13 | >_< \ No newline at end of file | 13 | >_< |
14 | :( | ||
15 | :| | ||
16 | :/ | ||
17 | :? \ No newline at end of file | ||
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) |