mahout-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sro...@apache.org
Subject svn commit: r1091538 [2/2] - in /mahout/trunk: core/src/main/java/org/apache/mahout/cf/taste/hadoop/ core/src/main/java/org/apache/mahout/cf/taste/hadoop/similarity/item/ core/src/main/java/org/apache/mahout/cf/taste/impl/model/ core/src/main/java/org/...
Date Tue, 12 Apr 2011 18:55:26 GMT
Modified: mahout/trunk/utils/src/main/java/org/apache/mahout/utils/vectors/lucene/ClusterLabels.java
URL: http://svn.apache.org/viewvc/mahout/trunk/utils/src/main/java/org/apache/mahout/utils/vectors/lucene/ClusterLabels.java?rev=1091538&r1=1091537&r2=1091538&view=diff
==============================================================================
--- mahout/trunk/utils/src/main/java/org/apache/mahout/utils/vectors/lucene/ClusterLabels.java
(original)
+++ mahout/trunk/utils/src/main/java/org/apache/mahout/utils/vectors/lucene/ClusterLabels.java
Tue Apr 12 18:55:25 2011
@@ -18,7 +18,6 @@
 package org.apache.mahout.utils.vectors.lucene;
 
 import java.io.File;
-import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.OutputStreamWriter;
 import java.io.Writer;
@@ -31,6 +30,7 @@ import java.util.List;
 import java.util.Map;
 
 import com.google.common.base.Charsets;
+import com.google.common.io.Files;
 import org.apache.commons.cli2.CommandLine;
 import org.apache.commons.cli2.Group;
 import org.apache.commons.cli2.Option;
@@ -105,7 +105,7 @@ public class ClusterLabels {
     if (this.output == null) {
       writer = new OutputStreamWriter(System.out);
     } else {
-      writer = new OutputStreamWriter(new FileOutputStream(new File(this.output)), Charsets.UTF_8);
+      writer = Files.newWriter(new File(this.output), Charsets.UTF_8);
     }
     try {
       for (Map.Entry<Integer, List<WeightedVectorWritable>> integerListEntry
: clusterIdToPoints.entrySet()) {

Modified: mahout/trunk/utils/src/main/java/org/apache/mahout/utils/vectors/lucene/Driver.java
URL: http://svn.apache.org/viewvc/mahout/trunk/utils/src/main/java/org/apache/mahout/utils/vectors/lucene/Driver.java?rev=1091538&r1=1091537&r2=1091538&view=diff
==============================================================================
--- mahout/trunk/utils/src/main/java/org/apache/mahout/utils/vectors/lucene/Driver.java (original)
+++ mahout/trunk/utils/src/main/java/org/apache/mahout/utils/vectors/lucene/Driver.java Tue
Apr 12 18:55:25 2011
@@ -18,12 +18,11 @@
 package org.apache.mahout.utils.vectors.lucene;
 
 import java.io.File;
-import java.io.FileOutputStream;
 import java.io.IOException;
-import java.io.OutputStreamWriter;
 import java.io.Writer;
-import java.nio.charset.Charset;
 
+import com.google.common.base.Charsets;
+import com.google.common.io.Files;
 import org.apache.commons.cli2.CommandLine;
 import org.apache.commons.cli2.Group;
 import org.apache.commons.cli2.Option;
@@ -212,7 +211,7 @@ public final class Driver {
         
         File dictOutFile = new File(cmdLine.getValue(dictOutOpt).toString());
         log.info("Dictionary Output file: {}", dictOutFile);
-        Writer writer = new OutputStreamWriter(new FileOutputStream(dictOutFile), Charset.forName("UTF8"));
+        Writer writer = Files.newWriter(dictOutFile, Charsets.UTF_8);
         DelimitedTermInfoWriter tiWriter = new DelimitedTermInfoWriter(writer, delimiter,
field);
         tiWriter.write(termInfo);
         tiWriter.close();



Mime
View raw message