Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Licence CC BY-NC-ND Thierry Parmentelat & Arnaud Legout

classe WordCounts

on veut calculer la fréquence d’apparition des mots dans un texte
pour cela on vous demande d’écrire une classe qui s’utilise comme ceci

wordcounts-data.txt: 1580 total words570 different words    the : 65
     he : 56
      a : 52
     to : 52
     it : 40
word arthur was found 16 times
word people was found 9 times
is word 'arthur' present ? : True 
is word 'armageddon' present ? : False 

Indices

variantes

word arthur was found 16 times
word people was found 9 times

solution