[Python] Contare parole

cm a python.it
Lun 27 Apr 2020 18:05:17 CEST


Il giorno lun 27 apr 2020 alle ore 17:53 Mara Leone
<maraleone95 a gmail.com> ha scritto:
> Il problema è che i dati contengono l'opera intera di Shakespeare e quello che vorrei trovare sono le parole più usate, ovviamente senza dover leggere tutto il testo…

Senza leggere tutto il testo la vedo dura.

> Il giorno lun 27 apr 2020 alle ore 17:38 Carlos Catucci <carlos.catucci a gmail.com> ha scritto:
>> Potresi creare una lista cui aggiungi mano mano le parole nuove che trovi e il contatore di occorrenze come liste

Meglio un dizionario parola:contatore. O, ancora di più, un
[collections.Counter](
https://docs.python.org/3.8/library/collections.html#collections.Counter
)

㎝

-- 
!!!! THE 🍺-WARE LICENSE (Revision ㊷):
    <㎝🐌🐍.🇮🇹> wrote this 📧. As long as you retain this notice you can
    do whatever you want with this stuff. If we meet some day, and you
    think this stuff is worth it, you can buy me a 🍺 in return. — ㎝


Maggiori informazioni sulla lista Python