-
Notifications
You must be signed in to change notification settings - Fork 1
/
cardlib.py
76 lines (71 loc) · 1.35 KB
/
cardlib.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
from Levenshtein import ratio
FirstContact=[
"Axolotl Healer",
"Bee Bear",
"Brain Fly",
"Chameleon Sniper",
"Compost Dragon",
"Deathweaver",
"Elephantopus",
"Explosive Toad",
"Ferret Bomber",
"Giraffodile",
"Goblin Werewolf",
"Gorillion",
"Grave Robber",
"Harpy Mother",
"Kangasaurus Rex",
"Killer Bee",
"Lone Yeti",
"Luchataur",
"Mysterious Mermaid",
"Plated Scorpion",
"Rhino Turtle",
"Shark Dog",
"Shield Bugs",
"Snail Hydra",
"Snail Thrower",
"Spider Owl",
"Strange Barrel",
"Tiger Squirrel",
"Turbo Bug",
"Tusked Extorter",
"Urchin Hurler",
]
NewCreatures=[
"Bugserker",
"Count Draculeech",
"Creep From The Deep",
"Ferret Pacifier",
"Froblin Instigator",
"Goreagle Alpha",
"Hamster Lion",
"Hungry Hungry Hamster",
"Hyenix",
"Majestic Manticore",
"The Lurker",
"Turf The Surfer"
]
Promos=[
"Slugapult",
"Mindbug Bug",
"Ratomancer",
"Ram Hopper",
"Boar-zooka",
"Sluggernaut",
"Chuck",
"Jazz Dog",
"Macaw Dagon",
"Unigon",
]
AllCards = FirstContact + NewCreatures + Promos
def SearchSimilar(name: str):
highest=0.0
found=None
searchedVal=name.lower()
for card in AllCards:
val = ratio(searchedVal, card.lower(), score_cutoff=0.65)
if val > 0 and val > highest:
highest = val
found = card
return found