mirror of
https://github.com/a2-4am/4cade.git
synced 2024-11-27 08:50:01 +00:00
fix search cache weighting algorithm
This commit is contained in:
parent
011948651a
commit
bae93a3424
@ -24,7 +24,7 @@ def score(inputbuffer, displayname):
|
|||||||
likely = False
|
likely = False
|
||||||
score += x
|
score += x
|
||||||
startat += y + 1
|
startat += y + 1
|
||||||
score = int((score/len(displayname)) + (score/len(inputbuffer))+0.99)
|
score = int(score/len(displayname) + (score/len(inputbuffer)) + 0.99)/2
|
||||||
if (inputbuffer[0] == displayname[0]) and (score < 85):
|
if (inputbuffer[0] == displayname[0]) and (score < 85):
|
||||||
score += 15
|
score += 15
|
||||||
return score, likely
|
return score, likely
|
||||||
@ -128,4 +128,5 @@ def main():
|
|||||||
print(f' !word {cache[a][b][c][d]}')
|
print(f' !word {cache[a][b][c][d]}')
|
||||||
print(' !byte 0')
|
print(' !byte 0')
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
BIN
res/CACHE00.IDX
BIN
res/CACHE00.IDX
Binary file not shown.
BIN
res/CACHE01.IDX
BIN
res/CACHE01.IDX
Binary file not shown.
BIN
res/CACHE10.IDX
BIN
res/CACHE10.IDX
Binary file not shown.
BIN
res/CACHE11.IDX
BIN
res/CACHE11.IDX
Binary file not shown.
Loading…
Reference in New Issue
Block a user