当前位置: 首页>>代码示例>>Java>>正文


Java ObjectOpenHashSet.contains方法代码示例

本文整理汇总了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);
}
 
开发者ID:gkiril,项目名称:minie,代码行数:23,代码来源:SubjDictionaryMinimization.java

示例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);
}
 
开发者ID:gkiril,项目名称:minie,代码行数:29,代码来源:RelDictionaryMinimization.java

示例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);
}
 
开发者ID:gkiril,项目名称:minie,代码行数:28,代码来源:ObjDictionaryMinimization.java

示例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;
}
 
开发者ID:htools,项目名称:htools,代码行数:8,代码来源:FHashMapSet.java

示例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;
}
 
开发者ID:htools,项目名称:htools,代码行数:8,代码来源:FHashMapIntSet.java

示例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);
}
 
开发者ID:htools,项目名称:htools,代码行数:6,代码来源:FHashMapSet.java

示例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);
}
 
开发者ID:htools,项目名称:htools,代码行数:6,代码来源:FHashMapIntSet.java


注:本文中的it.unimi.dsi.fastutil.objects.ObjectOpenHashSet.contains方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。