You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mahout.apache.org by ot...@apache.org on 2009/08/07 20:36:05 UTC
svn commit: r802139 - in
/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common:
FileLineIterable.java FileLineIterator.java
Author: otis
Date: Fri Aug 7 18:36:05 2009
New Revision: 802139
URL: http://svn.apache.org/viewvc?rev=802139&view=rev
Log:
- Added constructor that takes just a file and doesn't skip any lines
Modified:
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/FileLineIterable.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/FileLineIterator.java
Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/FileLineIterable.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/FileLineIterable.java?rev=802139&r1=802138&r2=802139&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/FileLineIterable.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/FileLineIterable.java Fri Aug 7 18:36:05 2009
@@ -35,6 +35,11 @@
private final boolean skipFirstLine;
/** Creates a {@link FileLineIterable} over a given file, assuming a UTF-8 encoding. */
+ public FileLineIterable(File file) {
+ this(file, Charset.forName("UTF-8"), false);
+ }
+
+ /** Creates a {@link FileLineIterable} over a given file, assuming a UTF-8 encoding. */
public FileLineIterable(File file, boolean skipFirstLine) {
this(file, Charset.forName("UTF-8"), skipFirstLine);
}
Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/FileLineIterator.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/FileLineIterator.java?rev=802139&r1=802138&r2=802139&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/FileLineIterator.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/FileLineIterator.java Fri Aug 7 18:36:05 2009
@@ -47,6 +47,16 @@
* @throws FileNotFoundException if the file does not exist
* @throws IOException if the file cannot be read
*/
+ public FileLineIterator(File file) throws IOException {
+ this(file, Charset.forName("UTF-8"), false);
+ }
+
+ /**
+ * Creates a {@link FileLineIterator} over a given file, assuming a UTF-8 encoding.
+ *
+ * @throws FileNotFoundException if the file does not exist
+ * @throws IOException if the file cannot be read
+ */
public FileLineIterator(File file, boolean skipFirstLine) throws IOException {
this(file, Charset.forName("UTF-8"), skipFirstLine);
}