本文整理汇总了Java中edu.stanford.nlp.util.FixedPrioritiesPriorityQueue类的典型用法代码示例。如果您正苦于以下问题:Java FixedPrioritiesPriorityQueue类的具体用法?Java FixedPrioritiesPriorityQueue怎么用?Java FixedPrioritiesPriorityQueue使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FixedPrioritiesPriorityQueue类属于edu.stanford.nlp.util包,在下文中一共展示了FixedPrioritiesPriorityQueue类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: asCounter
import edu.stanford.nlp.util.FixedPrioritiesPriorityQueue; //导入依赖的package包/类
/**
* Returns a counter whose keys are the elements in this priority queue, and
* whose counts are the priorities in this queue. In the event there are
* multiple instances of the same element in the queue, the counter's count
* will be the sum of the instances' priorities.
*
*/
public static <E> Counter<E> asCounter(FixedPrioritiesPriorityQueue<E> p) {
FixedPrioritiesPriorityQueue<E> pq = p.clone();
ClassicCounter<E> counter = new ClassicCounter<E>();
while (pq.hasNext()) {
double priority = pq.getPriority();
E element = pq.next();
counter.incrementCount(element, priority);
}
return counter;
}
开发者ID:FabianFriedrich,项目名称:Text2Process,代码行数:18,代码来源:Counters.java
示例2: asCounter
import edu.stanford.nlp.util.FixedPrioritiesPriorityQueue; //导入依赖的package包/类
/**
* Returns a counter whose keys are the elements in this priority queue, and
* whose counts are the priorities in this queue. In the event there are
* multiple instances of the same element in the queue, the counter's count
* will be the sum of the instances' priorities.
*
*/
public static <E> Counter<E> asCounter(FixedPrioritiesPriorityQueue<E> p) {
FixedPrioritiesPriorityQueue<E> pq = p.clone();
ClassicCounter<E> counter = new ClassicCounter<E>();
while (pq.hasNext()) {
double priority = pq.getPriority();
E element = pq.next();
counter.incrementCount(element, priority);
}
return counter;
}
开发者ID:paulirwin,项目名称:Stanford.NER.Net,代码行数:18,代码来源:Counters.java
注:本文中的edu.stanford.nlp.util.FixedPrioritiesPriorityQueue类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论