• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ObjectOpenHashSet类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中it.unimi.dsi.fastutil.objects.ObjectOpenHashSet的典型用法代码示例。如果您正苦于以下问题:Java ObjectOpenHashSet类的具体用法?Java ObjectOpenHashSet怎么用?Java ObjectOpenHashSet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ObjectOpenHashSet类属于it.unimi.dsi.fastutil.objects包,在下文中一共展示了ObjectOpenHashSet类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: retrieve

import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; //导入依赖的package包/类
public RetrievedResult retrieve(RequestContext requestContext) {
    ObjectSet<String> items = new ObjectOpenHashSet<>();
    List<ObjectNode> entities = new ArrayList<>(maxHits);
    for (Retriever retriever : retrievers) {
        long start = System.currentTimeMillis();
        RetrievedResult results = retriever.retrieve(requestContext);
        Logger.debug("{} time: {}", retriever, System.currentTimeMillis() - start);
        List<ObjectNode> initial = results.getEntityList();
        initial = ExpanderUtilities.expand(initial, expanders, requestContext);
        for (ObjectNode entity : initial) {
            String item = FeatureExtractorUtilities.composeConcatenatedKey(entity, itemAttrs);
            if (!items.contains(item)) {
                items.add(item);
                entities.add(entity);
                if (maxHits != null && entities.size() >= maxHits) {
                    return new RetrievedResult(entities, maxHits);
                }
            }
        }
    }
    return new RetrievedResult(entities, entities.size());
}
 
开发者ID:grouplens,项目名称:samantha,代码行数:23,代码来源:MultipleBlendingRetriever.java


示例5: getTriggeredFeaturesWithoutScore

import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; //导入依赖的package包/类
public List<ObjectNode> getTriggeredFeaturesWithoutScore(List<ObjectNode> bases) {
    ObjectSet<String> items = new ObjectOpenHashSet<>();
    for (ObjectNode inter : bases) {
        double weight = 1.0;
        if (inter.has(weightAttr)) {
            weight = inter.get(weightAttr).asDouble();
        }
        String key = FeatureExtractorUtilities.composeConcatenatedKey(inter, feaAttrs);
        if (weight >= 0.5 && featureKnnModel != null) {
            getNeighbors(items, featureKnnModel, key);
        }
        if (weight < 0.5 && featureKdnModel != null) {
            getNeighbors(items, featureKdnModel, key);
        }
    }
    List<ObjectNode> results = new ArrayList<>();
    for (String item : items) {
        ObjectNode entity = Json.newObject();
        Map<String, String> attrVals = FeatureExtractorUtilities.decomposeKey(item);
        for (Map.Entry<String, String> ent : attrVals.entrySet()) {
            entity.put(ent.getKey(), ent.getValue());
        }
        results.add(entity);
    }
    return results;
}
 
开发者ID:grouplens,项目名称:samantha,代码行数:27,代码来源:KnnModelFeatureTrigger.java


示例6: sameComponents

import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; //导入依赖的package包/类
public static void sameComponents( final int l, final StronglyConnectedComponentsTarjan componentsRecursive, final StronglyConnectedComponents componentsIterative ) {
	final LongOpenHashSet[] recursiveComponentsSet = new LongOpenHashSet[ componentsRecursive.numberOfComponents ];
	final LongOpenHashSet[] iterativeComponentsSet = new LongOpenHashSet[ componentsIterative.numberOfComponents ];
	
	for( int i = recursiveComponentsSet.length; i-- != 0; ) {
		recursiveComponentsSet[ i ] = new LongOpenHashSet();
		iterativeComponentsSet[ i ] = new LongOpenHashSet();
	}

	for( int i = l; i-- != 0; ) {
		recursiveComponentsSet[ componentsRecursive.component[ i ] ].add( i );
		iterativeComponentsSet[ componentsIterative.component[ i ] ].add( i );
	}

	assertEquals( new ObjectOpenHashSet<LongOpenHashSet>( recursiveComponentsSet ), new ObjectOpenHashSet<LongOpenHashSet>( iterativeComponentsSet ) );
}
 
开发者ID:lhelwerd,项目名称:WebGraph,代码行数:17,代码来源:StronglyConnectedComponentsTest.java


示例7: GetRowsFlowCache

import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; //导入依赖的package包/类
/**
 * 
 * Create a new GetRowsFlowCache.
 *
 * @param totalRequestNum total sub-requests number
 * @param matrixId matrix id
 * @param rowIndexToPartSizeCache row index to the number of partitions that contain this row map
 */
public GetRowsFlowCache(int totalRequestNum, int matrixId,
    Int2IntOpenHashMap rowIndexToPartSizeCache) {
  super(totalRequestNum);
  this.matrixId = matrixId;
  this.rowIndexToPartSizeCache = rowIndexToPartSizeCache;
  rowsSplitCache = new Int2ObjectOpenHashMap<List<ServerRow>>();
  rowsSplitFutures = new ObjectOpenHashSet<Future<List<ServerRow>>>(totalRequestNum);
}
 
开发者ID:Tencent,项目名称:angel,代码行数:17,代码来源:GetRowsFlowCache.java


示例8: removeIntersectionFrom

import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; //导入依赖的package包/类
public static boolean removeIntersectionFrom(Set<String> first, Set<String> second) {
	// TODO: test: Set<String> intersection = Sets.intersection(first, second);
	
	Set<String> intersection = new ObjectOpenHashSet<String>(first);
	intersection.retainAll(second);
	
	first.removeAll(intersection);
	second.removeAll(intersection);
	
	return !intersection.isEmpty();
}
 
开发者ID:HPI-Information-Systems,项目名称:metanome-algorithms,代码行数:12,代码来源:CollectionUtils.java


示例9: execute

import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; //导入依赖的package包/类
public void execute() throws AlgorithmExecutionException {

    ////////////////////////////////////////////
    // THE DISCOVERY ALGORITHM LIVES HERE :-) //
    ////////////////////////////////////////////
    // initialisation

    input = this.inputGenerator.generateNewCopy();
    this.relationName = input.relationName();
    this.columnNames = input.columnNames();
    Columns=new ArrayList<>();
    for (int i = 0; i < columnNames.size(); i++)
      Columns.add(new ObjectOpenHashSet<String>());
   
      //pass over the data
    while (input.hasNext()) {
      List<String> CurrentTuple=input.next();
      // pass for each column
      for (int i = 0; i < columnNames.size(); i++)
      {String currentvalue=CurrentTuple.get(i);
        if(currentvalue!=null && !currentvalue.trim().isEmpty())
            Columns.get(i).add(CurrentTuple.get(i).trim());
      }
      }
    
    // add the statistic for that column
    for (int i = 0; i < columnNames.size(); i++)
    addStatistic(NUMBEROFDISTINCT, Columns.get(i).size(), columnNames.get(i), relationName);   
  }
 
开发者ID:HPI-Information-Systems,项目名称:metanome-algorithms,代码行数:30,代码来源:DVAAlgorithm.java


示例10: removeIntersectionFrom

import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; //导入依赖的package包/类
public static boolean removeIntersectionFrom(Set<String> first, Set<String> second) {
	// TODO: test: Set<String> intersection = Sets.intersection(first, second);

	Set<String> intersection = new ObjectOpenHashSet<String>(first);
	intersection.retainAll(second);

	first.removeAll(intersection);
	second.removeAll(intersection);

	return !intersection.isEmpty();
}
 
开发者ID:HPI-Information-Systems,项目名称:AdvancedDataProfilingSeminar,代码行数:12,代码来源:CollectionUtils.java


示例11: listOfIndexedWordsToParentEdges

import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; //导入依赖的package包/类
/**
 *
 */
public static ObjectArrayList<SemanticGraphEdge> listOfIndexedWordsToParentEdges(SemanticGraph semanticGraph, ObjectOpenHashSet<IndexedWord> wordList) {
    ObjectArrayList<SemanticGraphEdge> result = new ObjectArrayList<>();
    for (IndexedWord word: wordList) {
        SemanticGraphEdge edge = semanticGraph.getEdge(semanticGraph.getParent(word), word);
        result.add(edge);
    }
    return result;
}
 
开发者ID:gkiril,项目名称:minie,代码行数:12,代码来源:CoreNLPUtils.java


示例12: getSortedWordsFromListOfEdges

import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; //导入依赖的package包/类
/**
 * Given a list of edges, get all the indexed words from them (their nodes) and return them sorted by index
 * @param edges: list of edges
 * @return list of indexed words sorted by index
 */
public static ObjectArrayList<IndexedWord> getSortedWordsFromListOfEdges(Set<SemanticGraphEdge> edges){
    ObjectOpenHashSet<IndexedWord> wordsSet = new ObjectOpenHashSet<>();
    for (SemanticGraphEdge e: edges){
        wordsSet.add(e.getGovernor());
        wordsSet.add(e.getDependent());
    }
    
    return getSortedWordsFromSetOfWords(wordsSet);
}
 
开发者ID:gkiril,项目名称:minie,代码行数:15,代码来源:CoreNLPUtils.java


示例13: getWordSetFromCoreMapList

import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; //导入依赖的package包/类
public static ObjectOpenHashSet<IndexedWord> getWordSetFromCoreMapList(List<CoreMap> coreMapList){
    ObjectOpenHashSet<IndexedWord> coreLabelSet = new ObjectOpenHashSet<>();
    for (CoreMap cm: coreMapList){
        coreLabelSet.add(new IndexedWord(new CoreLabel(cm)));
    }
    return coreLabelSet;
}
 
开发者ID:gkiril,项目名称:minie,代码行数:8,代码来源:CoreNLPUtils.java


示例14: getListsElementsCombinationSet

import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; //导入依赖的package包/类
/**
 * Given a list of lists, and a list of lists of integers, which is a combination of indices between the elements of 
 * "lists", get the set of all elements' combinations. For example, if we have a list of the list 'combinationsInd' which is
 * [1, 2], and the list of lists 'lists' is [[1, 2, 3], [4, 5], [6, 7, 8]], then this function will add the following lists 
 * to the result: [[4, 6], [4, 7], [4, 8], [5, 7], [5, 8]] 
 * @param combinationsInd: list of indices of the lists to be combined
 * @param lists: list of lists
 * @return
 */
public static <T> ObjectOpenHashSet<ObjectArrayList<T>> getListsElementsCombinationSet(
                        ObjectArrayList<IntArrayList> combinationsInd, ObjectArrayList<ObjectArrayList<T>> lists){
    ObjectOpenHashSet<ObjectArrayList<T>> combinationSets = new ObjectOpenHashSet<>();
    ObjectArrayList<ObjectArrayList<T>> tempLists = new ObjectArrayList<>();

    for (IntArrayList indList: combinationsInd){
        tempLists.clear();
        for (int index: indList){
            tempLists.add(lists.get(index));
        }
        combinationSets.addAll(getElementsCombinations(tempLists));
    }
    return combinationSets;
}
 
开发者ID:gkiril,项目名称:minie,代码行数:24,代码来源:FastUtil.java


示例15: AnnotatedPhrase

import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; //导入依赖的package包/类
/** Default constructor **/
public AnnotatedPhrase(){
    super();
    this.quantities = new ObjectArrayList<Quantity>();
    this.droppedEdges = new ObjectOpenHashSet<SemanticGraphEdge>();
    this.droppedWords = new ObjectOpenHashSet<IndexedWord>();
}
 
开发者ID:gkiril,项目名称:minie,代码行数:8,代码来源:AnnotatedPhrase.java


示例16: Modality

import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; //导入依赖的package包/类
/** Default constructor. Assumes 'certainty' modality type, creates empty lists of poss/cert words and edges **/
public Modality(){
    this.modalityType = Modality.Type.CERTAINTY;
    this.possibilityEdges = new ObjectOpenHashSet<SemanticGraphEdge>();
    this.possibilityWords = new ObjectOpenHashSet<IndexedWord>();
    this.certaintyWords = new ObjectOpenHashSet<IndexedWord>();
    this.certaintyEdges = new ObjectOpenHashSet<SemanticGraphEdge>();
}
 
开发者ID:gkiril,项目名称:minie,代码行数:9,代码来源:Modality.java


示例17: MinIE

import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; //导入依赖的package包/类
/** Default constructor **/
public MinIE(){
    this.propositions = new ObjectArrayList<AnnotatedProposition>();
    this.sentenceSemGraph = new SemanticGraph();
    this.sentence = new ObjectArrayList<>();
    this.propsWithAttribution = new ObjectOpenHashSet<>();
}
 
开发者ID:gkiril,项目名称:minie,代码行数:8,代码来源:MinIE.java


示例18: minimizeDictionaryMode

import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; //导入依赖的package包/类
/** Dictionary mode minimization **/
public void minimizeDictionaryMode(ObjectOpenHashSet<String> collocations){
    for (int i = 0; i < this.propositions.size(); i++){
        SubjDictionaryMinimization.minimizeSubject(this.getSubject(i), this.sentenceSemGraph, collocations);
        RelDictionaryMinimization.minimizeRelation(this.getRelation(i), this.sentenceSemGraph, collocations);
        ObjDictionaryMinimization.minimizeObject(this.getObject(i), this.sentenceSemGraph, collocations);
    }
    this.pushWordsToRelationsInPropositions();
}
 
开发者ID:gkiril,项目名称:minie,代码行数:10,代码来源:MinIE.java


示例19: minimizeSubject

import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; //导入依赖的package包/类
/**
 * Minimize only the subjects that are considered to have "safe patterns"
 * @param subject: the subject phrase
 * @param sg: the semantic graph of the whole sentence
 */
public static void minimizeSubject(AnnotatedPhrase subject, SemanticGraph sg){
    Minimization simp = new Minimization(subject, sg, new ObjectOpenHashSet<String>());
    
    // 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
    simp.nounPhraseSafeMinimization(remWords, matchWords);
    simp.namedEntitySafeMinimization(remWords, matchWords);
}
 
开发者ID:gkiril,项目名称:minie,代码行数:18,代码来源:SubjSafeMinimization.java


示例20: minimizationLeftFromVerb

import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; //导入依赖的package包/类
/**
 * Minimize the relations considered to have "safe patterns", and occur from the left of the verb
 * @param rel: the relation phrase
 * @param sg: the semantic graph of the sentence
 */
private static void minimizationLeftFromVerb(AnnotatedPhrase rel, SemanticGraph sg){
    // Minimization object
    Minimization simp = new Minimization(rel, sg, new ObjectOpenHashSet<String>());
    
    // 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<>(); 
    
    simp.verbPhraseSafeMinimization(remWords, matchWords);
}
 
开发者ID:gkiril,项目名称:minie,代码行数:17,代码来源:RelSafeMinimization.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ClassPrepareEvent类代码示例发布时间:2022-05-21
下一篇:
Java PathException类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap