Skip to main content

Multilingual word frequency statistics for Python based on subtitles corpora

Project description

Statistics about word frequencies in different languages based on a corpus of movie subtitles as extracted by the Frequency Words (https://github.com/hermitdave/FrequencyWords) project.

Currently supported languages (or language codes to be more precise :):

"da", "de", "el", "en", "es", "fr", "it", "nl", "no", "pl", "pt", "ro", "zh-CN" 

Usage Examples

Getting the info about a given word
>> from wordstats import Word
>> print (Word.stats('bleu', 'fr'))
bleu: (lang: fr, rank: 1521, freq: 9.42, imp: 9.42, diff: 0.03, klevel: 2)
Comparing the difficulty of two German words
>> from wordstats import Word
>> Word.stats('blauzungekrankenheit','de').difficulty > Word.stats('blau','de').difficulty
True
Top 10 most used words in Dutch
>> from wordstats import LanguageInfo
>> Dutch = LanguageInfo.load('nl')
>> print(Dutch.all_words()[:10])
['ik', 'je', 'het', 'de', 'dat', 'is', 'een', 'niet', 'en', 'van']
Words common across all the languages

Given that the corpus is based on subtitles, some common names have sliped in. The common_words() function returns a list.

>> from wordstats.common_words import common_words
>> for each in common_words():
>>     if len(each) > 9:
>>         print(each)
washington
christopher
enterprise
Words that are the same in Polish and Romanian
>> from wordstats import LanguageInfo
>> Polish = LanguageInfo.load("pl")
>> Romanian = LanguageInfo.load("ro")
>> for each in Polish.all_words():
>>     if each in Romanian.all_words():
>>         if len(each) > 5 and each not in common_words():
>>             print(each)
telefon
moment
prezent
interes
...

Installation

pip install wordstats

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wordstats-1.1.0.tar.gz (17.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wordstats-1.1.0-py3-none-any.whl (17.7 MB view details)

Uploaded Python 3

File details

Details for the file wordstats-1.1.0.tar.gz.

File metadata

  • Download URL: wordstats-1.1.0.tar.gz
  • Upload date:
  • Size: 17.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.4

File hashes

Hashes for wordstats-1.1.0.tar.gz
Algorithm Hash digest
SHA256 2572ea5a09470ad5c46d3a7e06152eb1e082b325c4858d29da9502e4f9e98853
MD5 fe5efde8a75480635cd167769ff2d345
BLAKE2b-256 b30a453d71d2b33b81ae8e700b438faf661687e65ce8c166750b546028e40eef

See more details on using hashes here.

File details

Details for the file wordstats-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: wordstats-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.4

File hashes

Hashes for wordstats-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 40e249e18904003900e275e2c08bc093231c7d09da0fc731042d8ff98d4f4fbc
MD5 dd98e4e0bc97f2253e7f7bb4d30fffbe
BLAKE2b-256 4f103ac990177a38455bb5897c9206d471c8f5faabc3a093461cbb99cc959776

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page