Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/omkarpathak/word-counter
A Python word counter module to quickly count number of words in a sentence
https://github.com/omkarpathak/word-counter
pypi pypi-packages python3 python3-library word-counter wordcount
Last synced: 10 days ago
JSON representation
A Python word counter module to quickly count number of words in a sentence
- Host: GitHub
- URL: https://github.com/omkarpathak/word-counter
- Owner: OmkarPathak
- License: gpl-2.0
- Created: 2018-09-19T15:24:30.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-05-11T17:38:41.000Z (over 3 years ago)
- Last Synced: 2024-11-28T23:40:54.153Z (24 days ago)
- Topics: pypi, pypi-packages, python3, python3-library, word-counter, wordcount
- Language: Python
- Homepage:
- Size: 14.6 KB
- Stars: 4
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Word-Counter
A Python Word Counter module
[![Downloads](https://pepy.tech/badge/wordcounter)](https://pepy.tech/project/wordcounter)
# Installation
```bash
pip install wordcounter
```# Usage
- Import the module after installation
```python
import wordcounter
```- Create a object with sentence and delimiter as arguments to WordCounter class. Default value for delimiter is ' ' (a single space)
```python
word_counter = WordCounter('The, quick, brown, fox, jumps, over, the, lazy, dog', delimiter=', ')
```- Get word count
```python
word_counter.get_word_count()
```- Get count of specific words
```python
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
```python
word_counter.get_word_frequencies()
```