summaryrefslogtreecommitdiff
path: root/spellchecker
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2015-04-04 16:16:17 +0200
committerPeter Wu <peter@lekensteyn.nl>2015-04-04 16:16:17 +0200
commite8f5721b7955e83562b8364b2717b9ef0983fac4 (patch)
treee0ca4243b6b3055b320c1c649dc8c37ea88b22d7 /spellchecker
parentbf3521be529d87331652547bcd207f3abd59cd0e (diff)
downloadassignment4-e8f5721b7955e83562b8364b2717b9ef0983fac4.tar.gz
Extend report
Diffstat (limited to 'spellchecker')
-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;
}