summaryrefslogtreecommitdiff
path: root/spellchecker/test/SpellCorrectorTest.java
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2015-04-01 04:10:47 +0200
committerPeter Wu <peter@lekensteyn.nl>2015-04-01 04:10:47 +0200
commit94838f67f689bf2123631555f13b5b2287f07118 (patch)
treef022b8abcbc8c155a62bd80a8e7205e60465a854 /spellchecker/test/SpellCorrectorTest.java
parentda199a9e8b3066eee67b947f2a8daeb368f8a7ee (diff)
downloadassignment4-94838f67f689bf2123631555f13b5b2287f07118.tar.gz
Do not include unchanged words
Diffstat (limited to 'spellchecker/test/SpellCorrectorTest.java')
-rw-r--r--spellchecker/test/SpellCorrectorTest.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/spellchecker/test/SpellCorrectorTest.java b/spellchecker/test/SpellCorrectorTest.java
index d658914..a826212 100644
--- a/spellchecker/test/SpellCorrectorTest.java
+++ b/spellchecker/test/SpellCorrectorTest.java
@@ -23,9 +23,14 @@ public class SpellCorrectorTest {
private void checkGetCandidateWords(CorpusReader cr, String word,
Set<String> expResult)
throws IOException {
+ // ignore unchanged word
+ expResult.remove(word);
+
System.out.println("getCandidateWords(" + word + ")");
SpellCorrector instance = new SpellCorrector(cr, cmr);
Set<String> result = instance.getCandidateWords(word).keySet();
+
+ assertFalse("Should not contain word " + word, result.contains(word));
// quick check: are the results of the same size?
assertEquals(expResult.size(), result.size());
// verbose test: are all letters as expected?