Skip to content

Overgeneralization of a regex #24

Description

@desialex

At the moment, because of the following regex, the verb "shed" gets necessarily rewritten as either "she had" or "she would".
re.compile(r"\bshe'?d\b", re.I | re.U): ["she had", "she would"],

It should be changed to include "shed" as a rewriting possibility which will ensure that occurrences such as "shed light on" obtain the highest probability score and remain unchanged.
re.compile(r"\bshe'?d\b", re.I | re.U): ["she had", "she would", "shed"],

https://github.com/ian-beaver/pycontractions/blob/master/pycontractions/contractions.py#L124

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions