about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--malaprop.cpp9
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
5bool removeIfM(char c) 7bool removeIfM(char c)
6{ 8{
@@ -87,8 +89,11 @@ malaprop::soundex malaprop::soundify(std::string f)
87void malaprop::addWord(std::string word) 89void 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
94void malaprop::stats() 99void malaprop::stats()