From 8b3cc4835c4c77df9f207bd342ffd024f0f726e7 Mon Sep 17 00:00:00 2001 From: iximeow Date: Wed, 26 Nov 2014 00:41:34 -0800 Subject: Rest of challenge 6 also hacking junk around the frequency maps. --- src/utils/FrequencyMap.scala | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/utils/FrequencyMap.scala') diff --git a/src/utils/FrequencyMap.scala b/src/utils/FrequencyMap.scala index fffdabe..e18fd46 100644 --- a/src/utils/FrequencyMap.scala +++ b/src/utils/FrequencyMap.scala @@ -14,7 +14,7 @@ class FrequencyMap(mapargs: Map[Char, Double]) { if (c.isLower) mappings.get(c) else // TODO remove the bias here - mappings.get(c.toLower).map(_ * 0.0002) // bias HARD against uppercase spam. should make this a per-map setting. + mappings.get(c.toLower).map(_ * 0.0004) // bias HARD against uppercase spam. should make this a per-map setting. def diff(other: FrequencyMap): Double = { // pseudoscience here @@ -38,7 +38,7 @@ class FrequencyMap(mapargs: Map[Char, Double]) { def diffAt(c: Char, charFreq: Double) = Math.pow(c match { case ' ' => - squared(0.10 - charFreq) + squared(0.09 - charFreq) case '{' | '}' | '`' | '|' | '^' => squared(0.000001 - charFreq) // { } | and ` are very unlikely irl case '[' | ']' => @@ -46,13 +46,15 @@ class FrequencyMap(mapargs: Map[Char, Double]) { case '"' | '\'' => squared(0.00001 - charFreq) // " or ' are 100% unlikely 90% of the time case '~' | '+' | '=' | '<' | '>' | '/' | '\\' => - squared(0.00000175 - charFreq) // math is weird kids + 1 //squared(charFreq) //squared(0.00000125 - charFreq) // math is weird kids case ';' | ':' | '-' | '*' | '(' | '&' | ')' | '_' => squared(0.000003 - charFreq) // getting into more common punctuation case '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' => squared(0.000002 - charFreq) // numbers are KINDA uncommon - case '$' | '%' | '#' | '@' | '!' => - squared(0.00002 - charFreq) // more punctuation... + case '$' | '%' | '#' | '@' => + 1 //squared(0.00002 - charFreq) // more punctuation... + case '!' => + squared(0.6 - charFreq) case '.' | ',' => squared(0.00007 - charFreq) // and the last of the punctuations case '\n' | '\r' => -- cgit v1.1