Python Algorithm for finding similar words
I wanted to do something like; Google did u mean.
Python Similar Words Projects Download
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 | def kelime_ekle(kelime): file=open("aa.txt","a+") file.write(kelime+";") def kelime_bul(kelime): f=open("aa.txt","r+") yeni=f.read() yeni=yeni.split(";") for i in range(len(yeni)): if(kelime==yeni[i]): print "bulundu :"+kelime def tahmin(kelime): maks=0 f=open("aa.txt","r+") yeni=f.read() yeni.split(";") for i in range(len(yeni)): puan=0 for j in range(len(kelime)): if(yeni[i][j]==kelime[j]): puan+=1 if(puan>maks): return yeni[i] sayi=input("1-kelime ekle 2-kelime arama 3-kelime tahmin") if(sayi==1): gelen=raw_input("gir") kelime_ekle(gelen) elif(sayi==2): aranan=raw_input("ara") kelime_bul(aranan) elif(sayi==3): gelen=raw_input("tahmin et") print(tahmin(gelen)) f=open("aa.txt","r+") yeni=f.read() yeni=yeni.split(";") for i in range(len(yeni)): print yeni[i], |