本文整理汇总了Java中it.unimi.dsi.fastutil.objects.ObjectOpenHashSet.contains方法的典型用法代码示例。如果您正苦于以下问题:Java ObjectOpenHashSet.contains方法的具体用法?Java ObjectOpenHashSet.contains怎么用?Java ObjectOpenHashSet.contains使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类it.unimi.dsi.fastutil.objects.ObjectOpenHashSet
的用法示例。
在下文中一共展示了ObjectOpenHashSet.contains方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: minimizeSubject
import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; //导入方法依赖的package包/类
public static void minimizeSubject(AnnotatedPhrase subject, SemanticGraph sg, ObjectOpenHashSet<String> collocations){
// Do the safe minimization first
SubjSafeMinimization.minimizeSubject(subject, sg);
// If the subject is frequent, don't minimize anything
if (collocations.contains(CoreNLPUtils.listOfWordsToLemmaString(subject.getWordList()).toLowerCase())){
return;
}
// Minimization object
Minimization simp = new Minimization(subject, sg, collocations);
// remWords: list of words to be removed (reusable variable)
// matchWords: list of matched words from the regex (reusable variable)
List<CoreMap> remWords = new ArrayList<>();
List<CoreMap> matchWords = new ArrayList<>();
// Safe minimization on the noun phrases and named entities within the subj. phrase
simp.nounPhraseDictMinimization(remWords, matchWords);
simp.removeVerbsBeforeNouns(remWords, matchWords);
simp.namedEntityDictionaryMinimization(remWords, matchWords);
}
示例2: minimizeRelation
import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; //导入方法依赖的package包/类
/**
* Minimize only the relations that are considered to have "non-frequent patterns"
* @param rel: the relation phrase
* @param sg: semantic graph of the sentence
* @param freqRels: dictionary of multi-word expressions (frequent relations)
*/
public static void minimizeRelation(AnnotatedPhrase rel, SemanticGraph sg, ObjectOpenHashSet<String> collocations){
// Do the safe minimization first
RelSafeMinimization.minimizeRelation(rel, sg);
// If the subject is frequent, don't minimize anything
if (collocations.contains(CoreNLPUtils.listOfWordsToLemmaString(rel.getWordList()).toLowerCase())){
return;
}
// Do the safe minimization first
RelSafeMinimization.minimizeRelation(rel, sg);
// remWords: list of words to be removed (reusable variable)
// matchWords: list of matched words from the regex (reusable variable)
List<CoreMap> remWords = new ArrayList<>();
List<CoreMap> matchWords = new ArrayList<>();
// Move to the dict. minimization of the noun phrases within the relation
Minimization simp = new Minimization(rel, sg, collocations);
simp.nounPhraseDictMinimization(remWords, matchWords);
simp.namedEntityDictionaryMinimization(remWords, matchWords);
}
示例3: minimizeObject
import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; //导入方法依赖的package包/类
/**
* Minimize only the objects that are considered to have "non-frequent patterns"
* @param obj: the object phrase
* @param sg: semantic graph of the sentence
* @param freqObjs: dictionary of multi-word expressions (frequent objects)
*/
public static void minimizeObject(AnnotatedPhrase obj, SemanticGraph sg, ObjectOpenHashSet<String> collocations){
// Do the safe minimization first
ObjSafeMinimization.minimizeObject(obj, sg);
// If the object is frequent, don't minimize anything
if (collocations.contains(CoreNLPUtils.listOfWordsToLemmaString(obj.getWordList()).toLowerCase())){
return;
}
// Minimization object
Minimization simp = new Minimization(obj, sg, collocations);
// remWords: list of words to be removed (reusable variable)
// matchWords: list of matched words from the regex (reusable variable)
List<CoreMap> remWords = new ArrayList<>();
List<CoreMap> matchWords = new ArrayList<>();
// Safe minimization on the noun phrases and named entities within the subj. phrase
simp.nounPhraseDictMinimization(remWords, matchWords);
simp.namedEntityDictionaryMinimization(remWords, matchWords);
}
示例4: contains
import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; //导入方法依赖的package包/类
public boolean contains(K k, V v) {
ObjectOpenHashSet<V> list = super.get(k);
if (list != null) {
return list.contains(v);
}
return false;
}
示例5: contains
import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; //导入方法依赖的package包/类
public boolean contains(int k, V v) {
ObjectOpenHashSet<V> list = super.get(k);
if (list != null) {
return list.contains(v);
}
return false;
}
示例6: addIfNotExists
import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; //导入方法依赖的package包/类
public void addIfNotExists(K k, V v) {
ObjectOpenHashSet<V> list = getSet(k);
if (!list.contains(v))
list.add(v);
}
示例7: addIfNotExists
import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; //导入方法依赖的package包/类
public void addIfNotExists(int k, V v) {
ObjectOpenHashSet<V> list = getSet(k);
if (!list.contains(v))
list.add(v);
}