Skip to content

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

License

Notifications You must be signed in to change notification settings

maximkir-fl/contractions

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

  • Python 100.0%