Package org.apache.mahout.utils.vectors.SequenceFileVectorIterable

Examples of org.apache.mahout.utils.vectors.SequenceFileVectorIterable.SeqFileIterator


          writer = new FileWriter(cmdLine.getValue(outputOpt).toString());
        } else {
          writer = new OutputStreamWriter(System.out);
        }
        boolean printKey = cmdLine.hasOption(printKeyOpt);
        SeqFileIterator iterator = (SeqFileIterator) vectorIterable.iterator();
        int i = 0;
        while (iterator.hasNext()) {
          Vector vector = iterator.next();
          if (printKey) {
            writer.write(iterator.key().toString());
            writer.write("\t");
          }
          String fmtStr = useJSON ? vector.asFormatString() : VectorHelper.vectorToString(vector, dictionary);
          writer.write(fmtStr);
          writer.write('\n');
View Full Code Here

TOP

Related Classes of org.apache.mahout.utils.vectors.SequenceFileVectorIterable.SeqFileIterator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.