Skip to content

Include 'an's along with 'a's as an article #19

@dhruvkb

Description

@dhruvkb

Problem

In many places the indefinite article 'a' is manipulated, either by stripping it away or treating it as 1. The article 'an' should be processed in the same way.

In all these regexes a should be replaced with an? to cover both articles.

Occurrences

string.gsub!(/\ba$/, '') && string.rstrip! # doesn't make sense for an 'a' at the end to be a 1

string.gsub!(/(^|\W)\ba\b(?=$|\W)(?! (?:#{ALL_ORDINALS_REGEX}))/i, '\1<num>' + 1.to_s)

string.gsub!(/(^|\W)\ba\b(?=$|\W)/i, '\1<num>' + 1.to_s)

Resolution

I could make a PR if there's consensus that this needs to be fixed.

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