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, org.apache.hadoop.fs.FileSystem fs, String filePattern)
          Read a dictionary in SequenceFile generated by org.apache.mahout.utils.vectors.text.DictionaryVectorizer
static String[] loadTermDictionary(File dictFile)
          Read in a dictionary file.
static String vectorToString(Vector vector, String[] dictionary)
          Create a String from a vector that fills in the values with the appropriate value from a dictionary where each the ith entry is the term for the ith vector cell..
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

vectorToString

public static String vectorToString(Vector vector,
                                    String[] dictionary)
Create a String from a vector that fills in the values with the appropriate value from a dictionary where each the ith entry is the term for the ith vector cell..

Parameters:
vector -
dictionary - The dictionary. See
Returns:
The String

loadTermDictionary

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

Parameters:
dictFile -
Throws:
IOException

loadTermDictionary

public static String[] loadTermDictionary(org.apache.hadoop.conf.Configuration conf,
                                          org.apache.hadoop.fs.FileSystem fs,
                                          String filePattern)
                                   throws IOException
Read a dictionary in SequenceFile generated by org.apache.mahout.utils.vectors.text.DictionaryVectorizer

Parameters:
conf -
fs -
filePattern - /dictionary.file-*
Throws:
IOException


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