Skip to content
Fixes contractions such as `you're` to you `are`
Python
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
contractions added month abbrevs, nothin', thats, cannot -> can not Jul 4, 2019
.gitignore initial commit Dec 25, 2016
README.md updated contractions to use TextSearch Jul 4, 2019
README.rst initial commit Dec 25, 2016
deploy.py solves #6 & black formatting Oct 20, 2018
setup.cfg initial commit Dec 25, 2016
setup.py bumped version Apr 23, 2019

README.md

contractions

Update: highly advised to use a contractions>0.0.18 as it is 50x faster.

This package is capable of resolving contractions (and slang), examples:

you're -> you are
i'm    -> I am
# uses \b boundaries for "unsafe"
ima    -> I am going to
yall  -> you all
gotta  -> got to

Note that in ambigious cases it will revert to the most common case:

he's -> he is (instead of he has)

Usage

import contractions
contractions.fix("you're happy now")
# "you are happy now"
contractions.fix("yall're happy now", slang=False) # default: true
# "yall are happy"
contractions.fix("yall're happy now")
# "you all are happy now"

Easy to add your own!

Since contractions>0.0.18, you can easily add your own:

import contractions
contractions.add('mychange', 'my change')

Installation

pip install contractions
You can’t perform that action at this time.