-
-
Notifications
You must be signed in to change notification settings - Fork 546
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
Acronym: add underscore test case #1436
Conversation
@link2xt thanks for opening the PR. The Travis CI build failed. Please check the details and correct the issue that it is reporting. Let me know if you have any questions. |
Excellent! Should the acronym of "Foo_Bar" be "FB" and not "F"? And should the acronym of "_Foo" be well-defined? This does not appear to be a clarification of the exercise, but an extension of it. And it seems to test two different things. So it would warrant two test cases and a major version bump. I am personally content with not having them, but I'm not seeing a lot of solutions to this exercise. I think your suggestion to teach that And I think that if the acronym of "Foo-Bar" is "FB", you can make the case for |
This has subtly pointed out that up to this point, all inputs have been written in a form that one might see in natural language. I think FOO_BAR is something I would not expect to see in natural language (but I could be convinced about The above comment must not be read as either variant of "I {support, oppose} adding |
I guess I will change this to look like markdown-emphasized word then. |
Many regular expression libraries have a way to detect word boundaries, but their definition of word characters includes underscores. \b and \w metacharacters were designed to detect programming language keywords, and it is a common mistake to use them to match words in natural languages.
I guess it is better not to test it then, because it is ambiguous, just like "FooBar", which is also not tested. But |
add underscore test case fix the text example to pass the newly added test case exercism/problem-specifications#1436
Many regular expression libraries have a way to detect word boundaries,
but their definition of word characters includes underscores.
\b
and\w
metacharacters were designed to detect programming language keywords,and it is a common mistake to use them to match words in natural languages.