创建一个人名实例

@param realWord
@param frequency
@return
337823
public static Vertex newPersonInstance(String realWord, int frequency)
    {
        return new Vertex(Predefine.TAG_PEOPLE, realWord, new CoreDictionary.Attribute(Nature.nr, frequency));
    }
249506
def frequency_model( self ):
        
        prev_letter = None
        # use a generator in corpus
        prev_letter = list(self.corpus.next_tamil_letter())[0]
        for next_letter in self.corpus.next_tamil_letter():
            # update frequency from corpus
            key = prev_letter+next_letter
            val = self.bigram.get(key,None)
            prev_letter = next_letter
            if not val:
                self.bigram[key] = 0
            self.bigram[key] += 1
        
        return
285093
def from_frequency(cls, freq):
        
        if 0 < freq <= 20000:
            return super(Tone, cls).__new__(cls, freq)
        raise ValueError('invalid frequency: %.2f' % freq)
1211967
public static void parseNature(Term term) {
		if (!Nature.NW.equals(term.natrue())) {
			return;
		}

		String name = term.getName();

		if (name.length() <= 3) {
			return;
		}

		// 是否是外国人名
		if (DATDictionary.foreign(term)) {
			term.setNature(NatureLibrary.getNature("nrf"));
			return;
		}

		List<Term> subTerm = term.getSubTerm();

		// TODO:判断是否是机构名

	}
223162
def convert_frequency(value):
    """"""
    value = value.strip()
    suffix = value[-1].lower()
    if suffix in ('k', 'm'):
        value = int(value[:-1])
        if suffix == 'k':
            value *= 1000
        elif suffix == 'm':
            value *= 1000000
        return value
    else:
        return int(value)
427527
def get_document_frequency(self, term):
        
        if term not in self._terms:
            raise IndexError(TERM_DOES_NOT_EXIST)
        else:
            return len(self._terms[term])
533419
public static Vertex newOrganizationInstance(String realWord, int frequency)
    {
        return new Vertex(Predefine.TAG_GROUP, realWord, new CoreDictionary.Attribute(Nature.nt, frequency));
    }
577519
public int getFrequency(final CharSequence word) {
    if (!dictionaryMetadata.isFrequencyIncluded()) {
      return 0;
    }

    final byte separator = dictionaryMetadata.getSeparator();
    try {
      byteBuffer = charSequenceToBytes(word);
    } catch (UnmappableInputException e) {
      return 0;
    }

    final MatchResult match = matcher.match(matchResult, byteBuffer.array(), 0, byteBuffer.remaining(), rootNode);
    if (match.kind == SEQUENCE_IS_A_PREFIX) {
      final int arc = fsa.getArc(match.node, separator);
      if (arc != 0 && !fsa.isArcFinal(arc)) {
        finalStatesIterator.restartFrom(fsa.getEndNode(arc));
        if (finalStatesIterator.hasNext()) {
          final ByteBuffer bb = finalStatesIterator.next();
          final byte[] ba = bb.array();
          final int bbSize = bb.remaining();
          //the last byte contains the frequency after a separator
          return ba[bbSize - 1] - FIRST_RANGE_CODE;
        }
      }
    }
    return 0;
  }
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
74119
@Override
    public List<String> getKeywords(List<Term> termList, int size)
    {
        clear();
        add(termList);
        Collection<TermFrequency> topN = top(size);
        List<String> r = new ArrayList<String>(topN.size());
        for (TermFrequency termFrequency : topN)
        {
            r.add(termFrequency.getTerm());
        }
        return r;
    }
1304013
private void addTermFrequencies(Reader r, Map<String, Int> termFreqMap, String fieldName) throws IOException
   {
      TokenStream ts = analyzer.tokenStream(fieldName, r);
      int tokenCount = 0;
      // for every token
      while (ts.incrementToken())
      {
         CharTermAttribute term = ts.getAttribute(CharTermAttribute.class);
         String word = new String(term.buffer(), 0, term.length());
         tokenCount++;
         if (tokenCount > maxNumTokensParsed)
         {
            break;
         }
         if (isNoiseWord(word))
         {
            continue;
         }

         // increment frequency
         Int cnt = termFreqMap.get(word);
         if (cnt == null)
         {
            termFreqMap.put(word, new Int());
         }
         else
         {
            cnt.x++;
         }
      }
      ts.end();
      ts.close();
   }
583006
public static boolean setAttribute(String word, String natureWithFrequency)
    {
        CoreDictionary.Attribute attribute = CoreDictionary.Attribute.create(natureWithFrequency);
        return setAttribute(word, attribute);
    }
1273263
public int getFrequency(String key)
    {
        TermFrequency termFrequency = get(key);
        if (termFrequency == null) return 0;
        return termFrequency.getFrequency();
    }
280028
public static int getFrequency(String word)
    {
        CoreDictionary.Attribute attribute = getAttribute(word);
        if (attribute == null) return 0;
        return attribute.totalFrequency;
    }
516238
public com.google.api.ads.admanager.axis.v201808.FrequencyCap getFrequencyCap() {
        return frequencyCap;
    }
875519
public static final String getQualifiedName(String localName, String pfx) {
		pfx = pfx == null ? "" : pfx;
		return pfx.length() == 0 ? localName
				: (pfx + Constants.COLON + localName);
	}
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