Find many members of a list in an other! Python -
i have problems find list members in other array. doesn't print errors prints anything.. code.. wanna search "parole" in frequenzaparolespamglob, list..this wrong code.. sorry bad english. in advance attention...
requenzaparolehamglob=counter() i=0 while < len(frequenzaparoleham): frequenzaparolehamglob= frequenzaparolehamglob + frequenzaparoleham[i] i=i+1 frequenzaparolespamglob=counter() i=0 while < len(frequenzaparolespam): frequenzaparolespamglob= frequenzaparolespamglob + frequenzaparolespam[i] i=i+1 sommafreqspam= sum(frequenzaparolespamglob.values()) sommafreqham= sum(frequenzaparolehamglob.values()) frequenzaparolespamglob=sorted(list(collections.counter(frequenzaparolespamglob).items())) frequenzaparolehamglob=sorted(list(collections.counter(frequenzaparolehamglob).items())) inputemail = input('inserisci una email:') parole = nltk.word_tokenize(inputemail) parole=[i in parole if not in listastop] parole = rimuovipunteggiatura.tokenize (str(parole)) parole=[i in parole if i.isalpha()] parole=[ps.stem(parola) parola in parole] print(len(parole)) parole=list(parole) while <len(parole): while < len(frequenzaparolespamglob): if parole[i] in frequenzaparolespamglob[i]: print('found entry:', parole[i])
Comments
Post a Comment