org.apache.mahout.utils.vectors
Class VectorHelper

java.lang.Object
  extended by org.apache.mahout.utils.vectors.VectorHelper

public final class VectorHelper
extends Object


Method Summary
static String[] loadTermDictionary(org.apache.hadoop.conf.Configuration conf, String filePattern)
          Read a dictionary in SequenceFile generated by DictionaryVectorizer
static String[] loadTermDictionary(File dictFile)
          Read in a dictionary file.
static String vectorToCSVString(Vector vector, boolean namesAsComments)
           
static void vectorToCSVString(Vector vector, boolean namesAsComments, Appendable bldr)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

vectorToCSVString

public static String vectorToCSVString(Vector vector,
                                       boolean namesAsComments)
                                throws IOException
Throws:
IOException

vectorToCSVString

public static void vectorToCSVString(Vector vector,
                                     boolean namesAsComments,
                                     Appendable bldr)
                              throws IOException
Throws:
IOException

loadTermDictionary

public static String[] loadTermDictionary(File dictFile)
                                   throws IOException
Read in a dictionary file. Format is:
 term DocFreq Index
 

Throws:
IOException

loadTermDictionary

public static String[] loadTermDictionary(org.apache.hadoop.conf.Configuration conf,
                                          String filePattern)
Read a dictionary in SequenceFile generated by DictionaryVectorizer

Parameters:
filePattern - /dictionary.file-*


Copyright © 2008-2011 The Apache Software Foundation. All Rights Reserved.