zemberek.core.collections.Histogram.contains()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(1.5k)|赞(0)|评价(0)|浏览(172)

本文整理了Java中zemberek.core.collections.Histogram.contains()方法的一些代码示例,展示了Histogram.contains()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Histogram.contains()方法的具体详情如下:
包路径:zemberek.core.collections.Histogram
类名称:Histogram
方法名:contains

Histogram.contains介绍

[英]if element exist.
[中]如果元素存在。

代码示例

代码示例来源:origin: ahmetaa/zemberek-nlp

public boolean containsKey(int order, String key) {
 return gramCounts[order].contains(key);
}

代码示例来源:origin: ahmetaa/zemberek-nlp

/**
 * Returns keys that both histogram contain.
 * @param other Another Histogram
 * @return A set of keys that both histogram contain.
 */
public Set<T> getIntersectionOfKeys(Histogram<T> other) {
 LinkedHashSet<T> result = new LinkedHashSet<>();
 Histogram<T> smaller = other.size() < size() ? other : this;
 Histogram<T> larger = smaller == this ? other : this;
 for (T t : smaller.getSortedList()) {
  if (larger.contains(t)) {
   result.add(t);
  }
 }
 return result;
}

代码示例来源:origin: ahmetaa/zemberek-nlp

continue;
if (correctFromClean.contains(a)) {
 mmClean.put(a, s);
 continue;
if (incorrectFromNoisy.contains(a)) {
 mm.put(a, s);

代码示例来源:origin: ahmetaa/zemberek-nlp

for (Token token : tokens) {
 String s = token.getText();
 if (local.correct.contains(s) || globalVocabulary.correct.contains(s)) {
  local.correct.add(s);
  continue;
 if (local.incorrect.contains(s) || globalVocabulary.incorrect.contains(s)) {
  local.incorrect.add(s);
  continue;
   token.getType() == TurkishLexer.Emoticon ||
   token.getType() == TurkishLexer.Unknown ||
   local.ignored.contains(s) ||
   globalVocabulary.ignored.contains(s) ||

相关文章