Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

About

Fixes contractions such as `you're` to you `are`

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages