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


Java MapFactory类代码示例

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


MapFactory类属于edu.stanford.nlp.util包,在下文中一共展示了MapFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: reverseIndexOrder

import edu.stanford.nlp.util.MapFactory; //导入依赖的package包/类
/**
 * Produces a new ConditionalCounter.
 *
 * @return a new ConditionalCounter, where order of indices is reversed
 */
@SuppressWarnings({"unchecked"})
public static <K1,K2> TwoDimensionalCounter<K2,K1> reverseIndexOrder(TwoDimensionalCounter<K1,K2> cc) {
  // they typing on the outerMF is violated a bit, but it'll work....
  TwoDimensionalCounter<K2,K1> result = new TwoDimensionalCounter<K2,K1>(
      (MapFactory)cc.outerMF, (MapFactory)cc.innerMF);

  for (K1 key1 : cc.firstKeySet()) {
    ClassicCounter<K2> c = cc.getCounter(key1);
    for (K2 key2 : c.keySet()) {
      double count = c.getCount(key2);
      result.setCount(key2, key1, count);
    }
  }
  return result;
}
 
开发者ID:FabianFriedrich,项目名称:Text2Process,代码行数:21,代码来源:TwoDimensionalCounter.java

示例2: reverseIndexOrder

import edu.stanford.nlp.util.MapFactory; //导入依赖的package包/类
/**
 * Produces a new ConditionalCounter.
 * 
 * @return a new ConditionalCounter, where order of indices is reversed
 */
@SuppressWarnings( { "unchecked" })
public static <K1, K2> TwoDimensionalCounter<K2, K1> reverseIndexOrder(TwoDimensionalCounter<K1, K2> cc) {
  // they typing on the outerMF is violated a bit, but it'll work....
  TwoDimensionalCounter<K2, K1> result = new TwoDimensionalCounter<K2, K1>((MapFactory) cc.outerMF,
      (MapFactory) cc.innerMF);

  for (K1 key1 : cc.firstKeySet()) {
    ClassicCounter<K2> c = cc.getCounter(key1);
    for (K2 key2 : c.keySet()) {
      double count = c.getCount(key2);
      result.setCount(key2, key1, count);
    }
  }
  return result;
}
 
开发者ID:paulirwin,项目名称:Stanford.NER.Net,代码行数:21,代码来源:TwoDimensionalCounter.java

示例3: reverseIndexOrder

import edu.stanford.nlp.util.MapFactory; //导入依赖的package包/类
/**
 * Produces a new ConditionalCounter.
 *
 * @return a new ConditionalCounter, where order of indices is reversed
 */
@SuppressWarnings({"unchecked"})
public static <K1,K2> TwoDimensionalIntCounter<K2,K1> reverseIndexOrder(TwoDimensionalIntCounter<K1,K2> cc) {
  // they typing on the outerMF is violated a bit, but it'll work....
  TwoDimensionalIntCounter<K2,K1> result = new TwoDimensionalIntCounter<K2,K1>(
      (MapFactory)cc.outerMF, (MapFactory)cc.innerMF);

  for (K1 key1 : cc.firstKeySet()) {
    IntCounter<K2> c = cc.getCounter(key1);
    for (K2 key2 : c.keySet()) {
      int count = c.getIntCount(key2);
      result.setCount(key2, key1, count);
    }
  }
  return result;
}
 
开发者ID:benblamey,项目名称:stanford-nlp,代码行数:21,代码来源:TwoDimensionalIntCounter.java

示例4: TwoDimensionalCounter

import edu.stanford.nlp.util.MapFactory; //导入依赖的package包/类
public TwoDimensionalCounter(MapFactory<K1, ClassicCounter<K2>> outerFactory,
    MapFactory<K2, MutableDouble> innerFactory) {
  innerMF = innerFactory;
  outerMF = outerFactory;
  map = outerFactory.newMap();
  total = 0.0;
}
 
开发者ID:paulirwin,项目名称:Stanford.NER.Net,代码行数:8,代码来源:TwoDimensionalCounter.java

示例5: IntCounter

import edu.stanford.nlp.util.MapFactory; //导入依赖的package包/类
/**
 * Constructs a new (empty) Counter.
 */
public IntCounter() {
  this(MapFactory.<E,MutableInteger>hashMapFactory());
}
 
开发者ID:FabianFriedrich,项目名称:Text2Process,代码行数:7,代码来源:IntCounter.java

示例6: getMapFactory

import edu.stanford.nlp.util.MapFactory; //导入依赖的package包/类
public MapFactory<E, MutableInteger> getMapFactory() {
  return ErasureUtils.<MapFactory<E,MutableInteger>>uncheckedCast(mapFactory);
}
 
开发者ID:FabianFriedrich,项目名称:Text2Process,代码行数:4,代码来源:IntCounter.java

示例7: getOuterMapFactory

import edu.stanford.nlp.util.MapFactory; //导入依赖的package包/类
public MapFactory<K1,ClassicCounter<K2>> getOuterMapFactory() {
  return outerMF;
}
 
开发者ID:FabianFriedrich,项目名称:Text2Process,代码行数:4,代码来源:TwoDimensionalCounter.java

示例8: getInnerMapFactory

import edu.stanford.nlp.util.MapFactory; //导入依赖的package包/类
public MapFactory<K2,MutableDouble> getInnerMapFactory() {
  return innerMF;
}
 
开发者ID:FabianFriedrich,项目名称:Text2Process,代码行数:4,代码来源:TwoDimensionalCounter.java

示例9: TwoDimensionalCounter

import edu.stanford.nlp.util.MapFactory; //导入依赖的package包/类
public TwoDimensionalCounter() {
  this(MapFactory.<K1,ClassicCounter<K2>>hashMapFactory(), MapFactory.<K2,MutableDouble>hashMapFactory());
}
 
开发者ID:FabianFriedrich,项目名称:Text2Process,代码行数:4,代码来源:TwoDimensionalCounter.java

示例10: ClassicCounter

import edu.stanford.nlp.util.MapFactory; //导入依赖的package包/类
/**
 * Constructs a new (empty) Counter backed by a HashMap.
 */
public ClassicCounter() {
  this(MapFactory.<E,MutableDouble>hashMapFactory());
}
 
开发者ID:FabianFriedrich,项目名称:Text2Process,代码行数:7,代码来源:ClassicCounter.java

示例11: ClassicCounterFactory

import edu.stanford.nlp.util.MapFactory; //导入依赖的package包/类
private ClassicCounterFactory(MapFactory<E,MutableDouble> mf) {
  this.mf = mf;
}
 
开发者ID:FabianFriedrich,项目名称:Text2Process,代码行数:4,代码来源:ClassicCounter.java

示例12: getOuterMapFactory

import edu.stanford.nlp.util.MapFactory; //导入依赖的package包/类
public MapFactory<K1, ClassicCounter<K2>> getOuterMapFactory() {
  return outerMF;
}
 
开发者ID:paulirwin,项目名称:Stanford.NER.Net,代码行数:4,代码来源:TwoDimensionalCounter.java

示例13: getInnerMapFactory

import edu.stanford.nlp.util.MapFactory; //导入依赖的package包/类
public MapFactory<K2, MutableDouble> getInnerMapFactory() {
  return innerMF;
}
 
开发者ID:paulirwin,项目名称:Stanford.NER.Net,代码行数:4,代码来源:TwoDimensionalCounter.java

示例14: TwoDimensionalMap

import edu.stanford.nlp.util.MapFactory; //导入依赖的package包/类
public TwoDimensionalMap() {
  this(MapFactory.<K1, Map<K2, V>>hashMapFactory(), MapFactory.<K2, V>hashMapFactory());
}
 
开发者ID:paulirwin,项目名称:Stanford.NER.Net,代码行数:4,代码来源:TwoDimensionalMap.java

示例15: treeMap

import edu.stanford.nlp.util.MapFactory; //导入依赖的package包/类
public static <K1, K2, V> TwoDimensionalMap<K1, K2, V> treeMap() {
  return new TwoDimensionalMap<K1, K2, V>(MapFactory.<K1, Map<K2, V>>treeMapFactory(), MapFactory.<K2, V>treeMapFactory());
}
 
开发者ID:paulirwin,项目名称:Stanford.NER.Net,代码行数:4,代码来源:TwoDimensionalMap.java


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