A simple Python module to count words in your given text and many more
Project description
A Python Word Counter module
Installation
pip install wordcounter
Usage
Import the module after installation
import wordcounter
Create a object with sentence and delimiter as arguments to WordCounter class. Default value for delimiter is ‘ ‘ (a single space)
word_counter = WordCounter('The, quick, brown, fox, jumps, over, the, lazy, dog', delimiter=', ')
Get word count
word_counter.get_word_count()
Get count of specific words
word_counter.count('the') # a case insensitive count
# if you want to have a case sensitive search just set ignore_case=False
word_counter.count('the', ignore_case=False) # a case sensitive count
Get word frequencies
word_counter.get_word_frequencies()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
wordcounter-0.0.2.2.tar.gz
(3.9 kB
view details)
File details
Details for the file wordcounter-0.0.2.2.tar.gz
.
File metadata
- Download URL: wordcounter-0.0.2.2.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: Python-urllib/3.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
a13333bb03733237eee9b4cf132fb5593ce12f4b9d8d5f7f8e1df1943f163373
|
|
MD5 |
bc0bea2623868bc820bfc07c89d6ddfe
|
|
BLAKE2b-256 |
7532528d26ac873dc904c8e8da4f899db5ed8014befb14e7838e3c20fc1f585d
|