mahout-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tdunn...@apache.org
Subject svn commit: r986666 - in /mahout/trunk: core/src/main/java/org/apache/mahout/vectors/ core/src/test/java/org/apache/mahout/vectors/ math/src/main/java/org/apache/mahout/math/matrix/linalg/
Date Wed, 18 Aug 2010 13:34:37 GMT
Author: tdunning
Date: Wed Aug 18 13:34:37 2010
New Revision: 986666

URL: http://svn.apache.org/viewvc?rev=986666&view=rev
Log:
Reverted a little bit of the Locale stuff.  I really
think it is better to use the default locale for normal
operations and only defeat that in testing.  Otherwise,
we really are treading on toes.

Modified:
    mahout/trunk/core/src/main/java/org/apache/mahout/vectors/WordValueEncoder.java
    mahout/trunk/core/src/test/java/org/apache/mahout/vectors/TextValueEncoderTest.java
    mahout/trunk/core/src/test/java/org/apache/mahout/vectors/WordLikeValueEncoderTest.java
    mahout/trunk/math/src/main/java/org/apache/mahout/math/matrix/linalg/Property.java

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/vectors/WordValueEncoder.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/vectors/WordValueEncoder.java?rev=986666&r1=986665&r2=986666&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/vectors/WordValueEncoder.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/vectors/WordValueEncoder.java Wed Aug
18 13:34:37 2010
@@ -59,7 +59,7 @@ public abstract class WordValueEncoder e
    */
   @Override
   public String asString(String originalForm) {
-    return String.format(Locale.ENGLISH, "%s:%s:%.4f", getName(), originalForm, weight(originalForm));
+    return String.format("%s:%s:%.4f", getName(), originalForm, weight(originalForm));
   }
 
   protected abstract double weight(String originalForm);

Modified: mahout/trunk/core/src/test/java/org/apache/mahout/vectors/TextValueEncoderTest.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/test/java/org/apache/mahout/vectors/TextValueEncoderTest.java?rev=986666&r1=986665&r2=986666&view=diff
==============================================================================
--- mahout/trunk/core/src/test/java/org/apache/mahout/vectors/TextValueEncoderTest.java (original)
+++ mahout/trunk/core/src/test/java/org/apache/mahout/vectors/TextValueEncoderTest.java Wed
Aug 18 13:34:37 2010
@@ -23,6 +23,8 @@ import org.apache.mahout.math.Vector;
 import org.junit.Assert;
 import org.junit.Test;
 
+import java.util.Locale;
+
 public class TextValueEncoderTest {
   @Test
   public void testAddToVector() {
@@ -56,6 +58,7 @@ public class TextValueEncoderTest {
 
   @Test
   public void testAsString() {
+    Locale.setDefault(Locale.ENGLISH);
     FeatureVectorEncoder enc = new TextValueEncoder("text");
     Assert.assertEquals("[text:test1:1.0000, text:and:1.0000, text:more:1.0000]", enc.asString("test1
and more"));
   }

Modified: mahout/trunk/core/src/test/java/org/apache/mahout/vectors/WordLikeValueEncoderTest.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/test/java/org/apache/mahout/vectors/WordLikeValueEncoderTest.java?rev=986666&r1=986665&r2=986666&view=diff
==============================================================================
--- mahout/trunk/core/src/test/java/org/apache/mahout/vectors/WordLikeValueEncoderTest.java
(original)
+++ mahout/trunk/core/src/test/java/org/apache/mahout/vectors/WordLikeValueEncoderTest.java
Wed Aug 18 13:34:37 2010
@@ -46,7 +46,7 @@ public class WordLikeValueEncoderTest {
 
   @Test
   public void testAsString() {
-    Locale.setDefault(new Locale("EN", "US"));
+    Locale.setDefault(Locale.ENGLISH);
     FeatureVectorEncoder enc = new StaticWordValueEncoder("word");
     Assert.assertEquals("word:w1:1.0000", enc.asString("w1"));
   }

Modified: mahout/trunk/math/src/main/java/org/apache/mahout/math/matrix/linalg/Property.java
URL: http://svn.apache.org/viewvc/mahout/trunk/math/src/main/java/org/apache/mahout/math/matrix/linalg/Property.java?rev=986666&r1=986665&r2=986666&view=diff
==============================================================================
--- mahout/trunk/math/src/main/java/org/apache/mahout/math/matrix/linalg/Property.java (original)
+++ mahout/trunk/math/src/main/java/org/apache/mahout/math/matrix/linalg/Property.java Wed
Aug 18 13:34:37 2010
@@ -1027,7 +1027,7 @@ public class Property extends Persistent
     for (String key : messages.keySet()) {
       maxLength = Math.max(key.length(), maxLength);
     }
-    String format = String.format(Locale.ENGLISH, "\\%%ds: \\%s\n", maxLength);
+    String format = String.format("\\%%ds: \\%s\n", maxLength);
 
     Formatter r = new Formatter();
     for (String key : messages.keySet()) {



Mime
View raw message