summaryrefslogtreecommitdiff
path: root/spellchecker/test/SpellCorrectorTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'spellchecker/test/SpellCorrectorTest.java')
-rw-r--r--spellchecker/test/SpellCorrectorTest.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/spellchecker/test/SpellCorrectorTest.java b/spellchecker/test/SpellCorrectorTest.java
index a00e236..d658914 100644
--- a/spellchecker/test/SpellCorrectorTest.java
+++ b/spellchecker/test/SpellCorrectorTest.java
@@ -12,18 +12,20 @@ import org.junit.Before;
public class SpellCorrectorTest {
private CorpusReader fullCR;
+ private ConfusionMatrixReader cmr;
@Before
public void setUp() throws IOException {
fullCR = new MockCorpusReader();
+ cmr = new ConfusionMatrixReader();
}
private void checkGetCandidateWords(CorpusReader cr, String word,
Set<String> expResult)
throws IOException {
System.out.println("getCandidateWords(" + word + ")");
- SpellCorrector instance = new SpellCorrector(cr, null);
- HashSet<String> result = instance.getCandidateWords(word);
+ SpellCorrector instance = new SpellCorrector(cr, cmr);
+ Set<String> result = instance.getCandidateWords(word).keySet();
// quick check: are the results of the same size?
assertEquals(expResult.size(), result.size());
// verbose test: are all letters as expected?