mahout-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r1003725 - /mahout/trunk/utils/src/main/java/org/apache/mahout/utils/vectors/VectorHelper.java
Date Sat, 02 Oct 2010 01:03:52 GMT
Author: drew
Date: Sat Oct  2 01:03:51 2010
New Revision: 1003725

URL: http://svn.apache.org/viewvc?rev=1003725&view=rev
Log:
MAHOUT-373: VectorDumper/VectorHelper doesn't dump values when dictionary is present

Modified:
    mahout/trunk/utils/src/main/java/org/apache/mahout/utils/vectors/VectorHelper.java

Modified: mahout/trunk/utils/src/main/java/org/apache/mahout/utils/vectors/VectorHelper.java
URL: http://svn.apache.org/viewvc/mahout/trunk/utils/src/main/java/org/apache/mahout/utils/vectors/VectorHelper.java?rev=1003725&r1=1003724&r2=1003725&view=diff
==============================================================================
--- mahout/trunk/utils/src/main/java/org/apache/mahout/utils/vectors/VectorHelper.java (original)
+++ mahout/trunk/utils/src/main/java/org/apache/mahout/utils/vectors/VectorHelper.java Sat
Oct  2 01:03:51 2010
@@ -63,8 +63,13 @@ public final class VectorHelper {
         bldr.append(", ");
       }
       Vector.Element elt = iter.next();
-      bldr.append(elt.index()).append(':').append(dictionary != null ? dictionary[elt.index()]
: elt.get());
-      
+      if (dictionary != null) {
+        bldr.append(dictionary[elt.index()]);
+      }
+      else {
+        bldr.append(elt.index());
+      }
+      bldr.append(':').append(elt.get());
     }
     return bldr.append('}').toString();
   }



Mime
View raw message