diff options
-rw-r--r-- | malaprop.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/malaprop.cpp b/malaprop.cpp index bfea579..7fbdb6c 100644 --- a/malaprop.cpp +++ b/malaprop.cpp | |||
@@ -1,6 +1,8 @@ | |||
1 | #include "malaprop.h" | 1 | #include "malaprop.h" |
2 | #include <cstdlib> | 2 | #include <cstdlib> |
3 | #include <iostream> | 3 | #include <iostream> |
4 | #include <algorithm> | ||
5 | #include <cstdio> | ||
4 | 6 | ||
5 | bool removeIfM(char c) | 7 | bool removeIfM(char c) |
6 | { | 8 | { |
@@ -87,8 +89,11 @@ malaprop::soundex malaprop::soundify(std::string f) | |||
87 | void malaprop::addWord(std::string word) | 89 | void malaprop::addWord(std::string word) |
88 | { | 90 | { |
89 | soundex ex = soundify(word); | 91 | soundex ex = soundify(word); |
90 | 92 | ||
91 | dict[ex].insert(canonizetwo(word)); | 93 | if (ex.prefix != 0) |
94 | { | ||
95 | dict[ex].insert(canonizetwo(word)); | ||
96 | } | ||
92 | } | 97 | } |
93 | 98 | ||
94 | void malaprop::stats() | 99 | void malaprop::stats() |