File size: 1,758 Bytes
c4827e2
 
e0cfb39
 
9e4ff58
e0cfb39
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cedfbe8
e0cfb39
 
 
 
 
 
 
 
 
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
with open('whatever stuff is neede/all pokemons.txt', 'r',encoding='latin-1') as a: all_pokemons = a.read().split(',')
with open('whatever stuff is neede/evolvable pokemons.txt', 'r',encoding='latin-1') as a: evolvable_pokemons = a.read().split(',')

import csv
with open('whatever stuff is neede/all.csv', 'r', encoding='latin-1') as stone: stone = {i[0].lower():i[2] for i in list(csv.reader(stone, delimiter=","))}
import difflib

if __name__=='__main__':
    pokemon = input('Can it evolve?????? ').lower()
    stuff = difflib.get_close_matches(pokemon, all_pokemons, n=1, cutoff=0)
    if len(stuff)==0: print(f'sry `{pokemon}` pokemon not found (idk why)')
    else:
        stuff=stuff[0].title()
        from difflib import SequenceMatcher as SM
        if SM(None, pokemon.title(), stuff).ratio()<0.6: print(f'NOTE idk if u meant {stuff} or not tho but thats the closest match')
        if stuff.lower() in stone: print(f'YES {stuff} can evolve: {stone[stuff.lower()]}')
        else: print(f'NO {stuff} can\'t evolve')

def isisisisis(pokemon,all_pokemons=all_pokemons, evolvable_pokemons=evolvable_pokemons,stone=stone):
    if len(pokemon) ==0: return 'Write pokemons name (it uses fuzzy search)'
    pokemon =pokemon.lower()
    stuff = difflib.get_close_matches(pokemon, all_pokemons, n=1, cutoff=0)
    if len(stuff)==0: return f'sry `{pokemon}` pokemon not found (idk why)'
    else:
        stuff=stuff[0].title()
        from difflib import SequenceMatcher as SM
        #if SM(None, pokemon.title(), stuff).ratio()<0.6: print(f'NOTE idk if u meant {stuff} or not tho but thats the closest match')
        if stuff.lower() in stone: return f'YES {stuff} can evolve: {stone[stuff.lower()]}'
        else: return f'NO {stuff} can\'t evolve'