public void addAll(String[] words) { //logger.debug(Arrays.toString(words)); for (int i = 0; i < words.length; i++) { add(words[i]); } }
/** * Returns a document in the VSM. */ public Node[] mapDocumentOld(BOW bow) { return mapDocument(bow); }
/** * Returns the index of this term in the VSM. */ public int termIndex(String term) throws TermNotFoundException { return termIndex.get(term); } // end termIndex
Example() { bow = new BOW(); freq = 0; }
/** * Returns a term in the VSM */ public Vector mapTerm(String term) throws TermNotFoundException { int i = termIndex.get(term); if (i == -1) { throw new TermNotFoundException(term); } return new DenseVector(Uk[i]); } // end mapTerm
public int termCount() { return termIndex.size(); } // end termCount
/** * Constructs a <code>FloatLSA</code> object. */ public FloatLSA(File UtFile, File SFile, File rowFile, File colFile, File dfFile, int dim, boolean rescaleIdf, boolean normalize) throws IOException { init(UtFile, SFile, rowFile, colFile, dfFile, dim, rescaleIdf, normalize); } // end constructor
/** * Returns a document in the VSM. */ public FloatVector mapDocument(BOW bow) { return mapDocument(bow, true); } // end map
/** * Constructs a <code>AbstractLSI</code> object. */ public AbstractLSI(File UtFile, File SFile, File rowFile, File colFile, File dfFile, int dim, boolean rescaleIdf, boolean normalize) throws IOException { init(UtFile, SFile, rowFile, colFile, dfFile, dim, rescaleIdf, normalize); } // end constructor
/** * Constructs a <code>DoubleLSA</code> object. */ public DoubleLSA(File UtFile, File SFile, File rowFile, File colFile, File dfFile, int dim, boolean rescaleIdf, boolean normalize) throws IOException { init(UtFile, SFile, rowFile, colFile, dfFile, dim, rescaleIdf, normalize); } // end constructor
public void read(Reader in, Stemmer stemmer) throws IOException { this.stemmer = stemmer; read(in); }
/** * Returns a document in the VSM. */ public DoubleVector mapDocument(BOW bow) { return mapDocument(bow, true); } // end map
public void addAll(String[] words, int from, int to) { //logger.debug(Arrays.toString(words)); for (int i = from; i < to; i++) { add(words[i]); } }
/** * Returns a term in the VSM */ public FloatVector mapTerm(String term) throws TermNotFoundException { int i = termIndex.get(term); if (i == -1) { throw new TermNotFoundException(term); } FloatVector nodes = new FloatVector(Uk[i]); return nodes; } // end mapTerm
/** * Returns the idf of the specified term if present in the index; -1 otherwise. */ public float getIdf(String term) { int index = termIndex.get(term); if (index == -1) { return 0; } return Iidf[index]; } // end getIdf
public int termCount() { return termIndex.size(); } // end termCount
/** * Returns the idf of the specified term if present in the index; -1 otherwise. */ public float getIdf(String term) { int index = termIndex.get(term); if (index == -1) { return 0; } return Iidf[index]; } // end getIdf
/** * Returns the idf of the specified term if present in the index; -1 otherwise. */ public double getIdf(String term) { int index = termIndex.get(term); if (index == -1) { return 0; } return Iidf[index]; } // end getIdf
/** * Returns the index of this term in the VSM. */ public int termIndex(String term) throws TermNotFoundException { return termIndex.get(term); } // end termIndex
/** * Returns the index of this term in the VSM. */ public int termIndex(String term) throws TermNotFoundException { return termIndex.get(term); } // end termIndex