mirror of
https://github.com/erkin/ponysay.git
synced 2024-11-25 05:47:59 +01:00
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:
parent
20b3cac03e
commit
93f481c8a3
1 changed files with 2 additions and 6 deletions
|
@ -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]
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue