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

Some tests do not work on Locales using "," as decimal separator. #14

Closed
wants to merge 3 commits into from
Closed

Some tests do not work on Locales using "," as decimal separator. #14

wants to merge 3 commits into from

Conversation

reckart
Copy link

@reckart reckart commented Jan 20, 2014

Bugfix change to get tests running on my non-US environment. Please consider this change to public domain.

@AngledLuffa
Copy link
Contributor

I can't help but feel that this isn't the right answer. Wouldn't it make
more sense for the test to use the local Locale so that people get output
in the format they expect?

John

On Mon, Jan 20, 2014 at 1:56 PM, Richard Eckart de Castilho <
[email protected]> wrote:

Bugfix change to get tests running on my non-US environment. Please

consider this change to public domain.

You can merge this Pull Request by running

git pull https://github.com/reckart/CoreNLP feature/localefix

Or view, comment on, or merge it at:

#14
Commit Summary

  • Some tests do not work on Locales using "," as decimal separator.
  • Some tests do not work on Locales using "," as decimal separator.
    Forcing Locale.US on formatting.
  • Revert whitespace changes.

File Changes

Patch Links:


Reply to this email directly or view it on GitHubhttps://github.com//pull/14
.

@AngledLuffa
Copy link
Contributor

For example, I just updated the ConfusionMatrix and its test so it will
hopefully work in your locale. A nice TODO would be to add expected output
for non-US Locales.

John

On Mon, Jan 20, 2014 at 8:03 PM, John Bauer [email protected] wrote:

I can't help but feel that this isn't the right answer. Wouldn't it make
more sense for the test to use the local Locale so that people get output
in the format they expect?

John

On Mon, Jan 20, 2014 at 1:56 PM, Richard Eckart de Castilho <
[email protected]> wrote:

Bugfix change to get tests running on my non-US environment. Please

consider this change to public domain.

You can merge this Pull Request by running

git pull https://github.com/reckart/CoreNLP feature/localefix

Or view, comment on, or merge it at:

#14
Commit Summary

  • Some tests do not work on Locales using "," as decimal separator.
  • Some tests do not work on Locales using "," as decimal separator.
    Forcing Locale.US on formatting.
  • Revert whitespace changes.

File Changes

Patch Links:


Reply to this email directly or view it on GitHubhttps://github.com//pull/14
.

@reckart
Copy link
Author

reckart commented Jan 21, 2014

Sure, there are these two ways to follow. I believe creating the expected output in a locale-sensitive way ends up being much more work in the long run. E.g. the expected output cannot easily be stored in a file. It must always be generated dynamically. So, unless there is a specific requirement to support internationalization, I tend to fix the locale. Isn't it strange too when the messages and errors are in English, but the numeric formats are localized?

@reckart
Copy link
Author

reckart commented Jan 21, 2014

So I'm closing this pull request too.

I wonder, you do not seem to be merging the pull requests. It appears you just look at the changes and redo them. Otherwise, I believe the commits that are part of the pull request would appear as part of the project history. Is there a specific reason for this? E.g. missing CLA or pull requests with too many changes? Either can be fixed/improved.

@reckart reckart closed this Jan 21, 2014
@AngledLuffa
Copy link
Contributor

Good observation. This is not the git repository we use internally, but a
mirror of the public code from a larger repository. It seemed like the
easiest way to make it so our experimental code was private and released
code was available. It also makes it easier to redo small changes rather
than pull twice.

I'm sure with a larger change such as the possible segmenter change, we'd
figure out how to pull from the public mirror,

John
On Jan 21, 2014 3:41 AM, "Richard Eckart de Castilho" <
[email protected]> wrote:

So I'm closing this pull request too.

I wonder, you do not seem to be merging the pull requests. It appears you
just look at the changes and redo them. Otherwise, I believe the commits
that are part of the pull request would appear as part of the project
history. Is there a specific reason for this? E.g. missing CLA or pull
requests with too many changes? Either can be fixed/improved.


Reply to this email directly or view it on GitHubhttps://github.com//pull/14#issuecomment-32856544
.

@AngledLuffa
Copy link
Contributor

The test output doesn't have to be dynamically generated if you test the
results for a specific Locale, though, right? For example, the
ConfusionMatrix change I just submitted tests for US. It seems like
CountersTest could be set to test for US as well by calling
Locale.setDefault at the start of the test.

Would you check to see if the tests now pass? Thanks!

On Tue, Jan 21, 2014 at 3:37 AM, Richard Eckart de Castilho <
[email protected]> wrote:

Sure, there are these two ways to follow. I believe creating the expected
output in a locale-sensitive way ends up being much more work in the long
run. E.g. the expected output cannot easily be stored in a file. It must
always be generated dynamically. So, unless there is a specific requirement
to support internationalization, I tend to fix the locale. Isn't it strange
too when the messages and errors are in English, but the numeric formats
are localized?


Reply to this email directly or view it on GitHubhttps://github.com//pull/14#issuecomment-32849905
.

@reckart
Copy link
Author

reckart commented Jan 21, 2014

It appears to pass. Setting Locale.setDefault() sounds like a very good solution because it doesn't actually require changes to the API.

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.

2 participants