Expanding English language contractions in Python

后端 未结 9 1547
野性不改
野性不改 2020-12-04 11:19

The English language has a couple of contractions. For instance:

you\'ve -> you have
he\'s -> he is

These can sometimes cause headach

9条回答
  •  星月不相逢
    2020-12-04 11:49

    I have found a library for this, contractions Its very simple.

    import contractions
    print(contractions.fix("you've"))
    print(contractions.fix("he's"))
    

    Output:

    you have
    he is
    

提交回复
热议问题