-
Notifications
You must be signed in to change notification settings - Fork 252
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
"a" modifier doesn't account for cases like "useful" #32
Comments
Regex could be expanded to use an "a" instead of an "an" for any /use.*/g match. |
The issue is slightly wider than the |
The rule to check if first letter is vowel or not is wrong but cover most of cases as mentioned in the Stack Exchange question. Choosing between
Basically you have to implement your own language modifier if you want to have specific language features in your app. You can't cover the complexity of the English language rules in just a few lines of code, the modifier in this repo is just a template. I forked the project and I am working on extracting the modifiers stuff to let people build their own. See https://github.com/mycaule/epures/tree/master/modifiers The methodology should be to write lots of unit tests to make sure the language rules you want --but sadly not every rules-- are covered by the code. |
In JS language rules are implemented in the library |
In this grammar:
The expected output from
start
would be"a useful tool like Tracery"
, but instead we get"an useful tool like Tracery"
. I haven't tried Tracery 2, but looking at its altereda
function I think the problem would remain (since the third letter isn'ti
).The most reliable function I've found to do this job is in inflect.py, although its regex usage isn't especially readable.
The text was updated successfully, but these errors were encountered: