lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [02/26] lucenenet git commit: Lucene.Net.QueryParser.Classic.QueryParserBase.HandleBoost(): Changed implementation to use invariant culture to handle the decimal separator for boost since it apparently does that in Java
Date Wed, 08 Mar 2017 18:23:38 GMT
Lucene.Net.QueryParser.Classic.QueryParserBase.HandleBoost(): Changed implementation to use
invariant culture to handle the decimal separator for boost since it apparently does that
in Java


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/ee04a8c1
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/ee04a8c1
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/ee04a8c1

Branch: refs/heads/api-work
Commit: ee04a8c1b57cfc603bb52e650e9a9e798526e0ae
Parents: 6c707fe
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Tue Mar 7 19:52:25 2017 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Tue Mar 7 19:52:25 2017 +0700

----------------------------------------------------------------------
 src/Lucene.Net.QueryParser/Classic/QueryParserBase.cs | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ee04a8c1/src/Lucene.Net.QueryParser/Classic/QueryParserBase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Classic/QueryParserBase.cs b/src/Lucene.Net.QueryParser/Classic/QueryParserBase.cs
index 712dcf2..0ec2a54 100644
--- a/src/Lucene.Net.QueryParser/Classic/QueryParserBase.cs
+++ b/src/Lucene.Net.QueryParser/Classic/QueryParserBase.cs
@@ -877,7 +877,14 @@ namespace Lucene.Net.QueryParsers.Classic
                 float f = (float)1.0;
                 try
                 {
-                    f = float.Parse(boost.Image, Locale);
+                    // LUCENENET NOTE: Apparently a "feature" of Lucene is to always
+                    // use "." as the decimal specifier for boost, even if the culture uses
+                    // a different one, such as ",".
+
+                    // LUCENENET TODO: It would probably be more intuitive to use
+                    // the current Locale to specify the decimal identifier than
+                    // to hard code it to be ".", but this would differ from Java Lucene.
+                    f = float.Parse(boost.Image, CultureInfo.InvariantCulture);
                 }
                 catch (Exception /*ignored*/)
                 {


Mime
View raw message