for (int i=0; i<len; i++) if (minDF > 0 && allTerms[i].getDocumentFrequency() < minDF && !originalTermids.contains(allTerms[i].getTermID()))
for (int i=0; i<len; i++) if (minDF > 0 && allTerms[i].getDocumentFrequency() < minDF && !originalTermids.contains(allTerms[i].getTermID()))
/** Returns the probability of a given termid occurring * in the expansion documents. Returns the quotient * document frequency in the expansion documents, divided * by the total length of all the expansion documents. * @param termId int the term identifier to obtain the probability * @return double the probability of the term */ public double getExpansionProbability(int termId) { ExpansionTerm o = terms.get(termId); if (o == null) return -1; return o.getDocumentFrequency() / totalDocumentLength; } /**
/** Returns the probability of a given termid occurring * in the expansion documents. Returns the quotient * document frequency in the expansion documents, divided * by the total length of all the expansion documents. * @param termId int the term identifier to obtain the probability * @return double the probability of the term */ public double getExpansionProbability(int termId) { ExpansionTerm o = terms.get(termId); if (o == null) return -1; return o.getDocumentFrequency() / totalDocumentLength; } /**
/** * Returns the number of the top-ranked documents a given term occurs in. * @param termId int the id of the term to get the frequency for. * @return double the document frequency of the specified term in the top-ranked documents. */ public double getDocumentFrequency(int termId){ ExpansionTerm o = terms.get(termId); if (o == null) return 0; return o.getDocumentFrequency(); }
/** * Returns the number of the top-ranked documents a given term occurs in. * @param termId int the id of the term to get the frequency for. * @return double the document frequency of the specified term in the top-ranked documents. */ public double getDocumentFrequency(int termId){ ExpansionTerm o = terms.get(termId); if (o == null) return 0; return o.getDocumentFrequency(); }