Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "18" to AN_REQUIRING_PATTERNS #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add "18" to AN_REQUIRING_PATTERNS #16

wants to merge 1 commit into from

Conversation

fatcatt316
Copy link

For example, you'd want "An 18 point lead" instead of "A 18 point lead".

For example, you'd want "An 18 point lead" instead of "A 18 point lead".
@rossmeissl
Copy link
Owner

@fatcatt316 thanks for your PR! A couple of comments:

  • Can you please include a testcase?
  • I'm not sure this is as complete as it can be. For example, consider the phrase "a 183-toed marmot" which this patch would incorrectly present as "an 183-toed marmot."

Thanks again!

@jongaegler
Copy link

jongaegler commented Jul 27, 2016

A_REQUIRING_PATTERNS = /^(([bcdgjkpqtuvwyz]|onc?e|one(armed|time)|ouija|oaxaca(n|nia|nthaxia)?)$|e[uw]|uk|ub[io]|ufo|ur[aeiou]|use|ut([^t])|unani|uni(l[^l]|[a-ko-z]))/i
AN_REQUIRING_PATTERNS = /^([aefhilmnorsx]$|hono|honest|hour|heir|herb|[aeiou]|8|1[18](\d{3})*(\D|$))/i

I'm having trouble pushing to this repo ¯_(ツ)_/¯ but here are the regex catching those cases, as well as optimizing some of the searches in javascript. I think it translates exactly in ruby

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants