From e8f5721b7955e83562b8364b2717b9ef0983fac4 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Sat, 4 Apr 2015 16:16:17 +0200 Subject: Extend report --- spellchecker/src/SpellCorrector.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'spellchecker') diff --git a/spellchecker/src/SpellCorrector.java b/spellchecker/src/SpellCorrector.java index f3e504d..875213f 100644 --- a/spellchecker/src/SpellCorrector.java +++ b/spellchecker/src/SpellCorrector.java @@ -13,6 +13,7 @@ public class SpellCorrector { /** * The highest n-gram to look for. 1 gives a unigram, 2 gives a bigram, etc. + * Be sure that the CorupusReader actually provide such many details! */ private final static int NGRAM_N = 2; @@ -335,6 +336,9 @@ public class SpellCorrector { } p *= score; } + // this can happen if probability_non_word or + // LM_PROBABILITY_UNMODIFIED are badly chosen (too small). + assert p > 0 : "The combined probabilities were too small"; return p; } -- cgit v1.2.1