Gets the frequency of the specified term in the entire corpus
        added to the HashedIndex.
502905
def get_total_term_frequency(self, term):
        
        if term not in self._terms:
            raise IndexError(TERM_DOES_NOT_EXIST)

        return sum(self._terms[term].values())
1282256
def filter(self, term_doc_matrix):
		'''
		
		'''
		df = term_doc_matrix.get_term_freq_df()
		if len(df) == 0:
			return term_doc_matrix
		low_pmi_bigrams = get_low_pmi_bigrams(self._threshold_coef, df).index
		infrequent_terms = df[df.sum(axis=1) < self._min_freq].index
		filtered_term_doc_mat = term_doc_matrix.remove_terms(set(low_pmi_bigrams | infrequent_terms))
		try:
			filtered_term_doc_mat.get_term_freq_df()
		except ValueError:
			raise AtLeastOneCategoryHasNoTermsException()
		return filtered_term_doc_mat
1012676
private double getScore(int pos, Lexicon lexicon, double numdocs) {
		double score = 0;
		int indexTerm = this.indices[pos];
		double occurences = (double) this.freqs[pos];

		int fieldNum = this.indexToField[pos];
		double frequency = occurences / tokensPerField[fieldNum];

		// is there a custom weight for this field?
		String fieldName = lexicon.getFields()[fieldNum];
		WeightingMethod method = lexicon.getMethod(fieldName);

		if (method.equals(Parameters.WeightingMethod.BOOLEAN)) {
			score = 1;
		} else if (method.equals(Parameters.WeightingMethod.OCCURRENCES)) {
			score = occurences;
		} else if (method.equals(Parameters.WeightingMethod.FREQUENCY)) {
			score = frequency;
		} else if (method.equals(Parameters.WeightingMethod.TFIDF)) {
			int df = lexicon.getDocFreq(indexTerm);
			double idf = numdocs / (double) df;
			score = frequency * Math.log(idf);
			if (idf == 1)
				score = frequency;
		}
		return score;
	}
45645
public static List<String> getKeywordList(String document, int size)
    {
        return new TermFrequencyCounter().getKeywords(document, size);
    }
1035806
def call
      words = stems_for(remove_stopwords_in(@words))
      score_words(frequencies_for(words))

      scores.key(scores.values.max)
    end
1217913
function countNgrams(ngram) {
  nrOfNgrams++;
  var key = arrayToKey(ngram);
  if (!frequencies[key]) {
    frequencies[key] = 0;
  }
  frequencies[key]++;
}
279394
def term_group_freq_df(self, group_col):
        # type: (str) -> pd.DataFrame
        '''
        
        '''
        group_idx_store = IndexStore()
        X = self._X
        group_idx_to_cat_idx, row_group_cat \
            = self._get_group_docids_and_index_store(X, group_col, group_idx_store)
        newX = self._change_document_type_in_matrix(X, row_group_cat)
        newX = self._make_all_positive_data_ones(newX)
        category_row = newX.tocoo().row
        for group_idx, cat_idx in group_idx_to_cat_idx.items():
            category_row[category_row == group_idx] = cat_idx
        catX = self._change_document_type_in_matrix(newX, category_row)
        return self._term_freq_df_from_matrix(catX)
623001
def frequency(self):
        
        freqOptions = ("YEARLY", "MONTHLY", "WEEKLY", "DAILY")
        if self.rule._freq < len(freqOptions):
            return freqOptions[self.rule._freq]
        else:
            return "unsupported_frequency_{}".format(self.rule._freq)
844398
def get_info_content(go_id, termcounts):
    '''
        
    '''
    # Get the observed frequency of the GO term
    freq = termcounts.get_term_freq(go_id)

    # Calculate the information content (i.e., -log("freq of GO term")
    return -1.0 * math.log(freq) if freq else 0
1311423
def get_term_category_frequencies(self, scatterchartdata):
		'''
		
		'''

		df = self.term_category_freq_df.rename(
			columns={c: c + ' freq' for c in self.term_category_freq_df}
		)
		df.index.name = 'term'
		return df
1031802
public boolean loadDictionary(String corpus, int termIndex, int countIndex) {
    File file = new File(corpus);
    if (!file.exists()) {
      return false;
    }

    BufferedReader br = null;
    try {
      br = Files.newBufferedReader(Paths.get(corpus), StandardCharsets.UTF_8);
    } catch (IOException ex) {
      System.out.println(ex.getMessage());
    }
    if (br == null) {
      return false;
    }
    return loadDictionary(br, termIndex, countIndex);
  }
407419
public int getDocumentFrequency(Token token) 
    { 
        Integer df = (Integer)documentFrequency.get(token);
        if (df == null) return 0;
        else return df.intValue();
    }
202990
def get_term_freq(self, go_id):
        '''
            
        '''
        num_ns = float(self.get_total_count(self.go2obj[go_id].namespace))
        return float(self.get_count(go_id))/num_ns if num_ns != 0 else 0
336597
def default_freq(**indexer):
    """"""
    freq = 'AS-JAN'
    if indexer:
        if 'DJF' in indexer.values():
            freq = 'AS-DEC'
        if 'month' in indexer and sorted(indexer.values()) != indexer.values():
            raise (NotImplementedError)

    return freq
1242910
public static int getTermFrequency(String term)
    {
        Attribute attribute = get(term);
        if (attribute == null) return 0;
        return attribute.totalFrequency;
    }
468270
def get_term_category_frequencies(self, scatterchartdata):
        '''
        
        '''
        term_ranker = scatterchartdata.term_ranker(self)
        if scatterchartdata.use_non_text_features:
            term_ranker.use_non_text_features()
        return term_ranker.get_ranks()
383006
@NonNegative
  public int frequency(@NonNull E e) {
    if (isNotInitialized()) {
      return 0;
    }

    int hash = spread(e.hashCode());
    int start = (hash & 3) << 2;
    int frequency = Integer.MAX_VALUE;
    for (int i = 0; i < 4; i++) {
      int index = indexOf(hash, i);
      int count = (int) ((table[index] >>> ((start + i) << 2)) & 0xfL);
      frequency = Math.min(frequency, count);
    }
    return frequency;
  }