summaryrefslogtreecommitdiff
path: root/spellchecker/src/SpellCorrector.java
diff options
context:
space:
mode:
Diffstat (limited to 'spellchecker/src/SpellCorrector.java')
-rw-r--r--spellchecker/src/SpellCorrector.java4
1 files changed, 4 insertions, 0 deletions
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;
}