From 93f481c8a33122e23fda06c0a91bfb476c4eb9a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Andr=C3=A9e?= Date: Wed, 8 Oct 2014 04:24:33 +0200 Subject: [PATCH] spellocorrector: I think I've missed a port to make this funkyness work properly so lets downgrade the optimisation a bit --- src/spellocorrecter.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/spellocorrecter.py b/src/spellocorrecter.py index 375a7b65..579a6505 100755 --- a/src/spellocorrecter.py +++ b/src/spellocorrecter.py @@ -239,15 +239,10 @@ class SpelloCorrecter(): # Naïvely and quickly ported and adapted from optimise while x < xn: change = my[x] u = used[x] - if p == u: - # commence black magick … twilight would be so disappointed - x += 1 - myy[x] = change - best = min(best, change) remove = myy[x] add = my[x + 1] - cw = 1 + cw = 0 if p == u else 1 if my[x] in self.weights: if p in self.weights[u]: cw = self.weights[u][p] @@ -260,5 +255,6 @@ class SpelloCorrecter(): # Naïvely and quickly ported and adapted from optimise if best > self.closestDistance: return 0x7FFFFF00 | y my = myy + return my[xn]