spellocorrector: I think I've missed a port to make this funkyness work properly so lets downgrade the optimisation a bit

This commit is contained in:
Mattias Andrée 2014-10-08 04:24:33 +02:00
parent 20b3cac03e
commit 93f481c8a3

View file

@ -239,15 +239,10 @@ class SpelloCorrecter(): # Naïvely and quickly ported and adapted from optimise
while x < xn: while x < xn:
change = my[x] change = my[x]
u = used[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] remove = myy[x]
add = my[x + 1] add = my[x + 1]
cw = 1 cw = 0 if p == u else 1
if my[x] in self.weights: if my[x] in self.weights:
if p in self.weights[u]: if p in self.weights[u]:
cw = self.weights[u][p] cw = self.weights[u][p]
@ -260,5 +255,6 @@ class SpelloCorrecter(): # Naïvely and quickly ported and adapted from optimise
if best > self.closestDistance: if best > self.closestDistance:
return 0x7FFFFF00 | y return 0x7FFFFF00 | y
my = myy my = myy
return my[xn] return my[xn]