本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例5: IntCounter
import edu.stanford.nlp.util.MapFactory; //导入依赖的package包/类
/**
* Constructs a new (empty) Counter.
*/
public IntCounter() {
this(MapFactory.<E,MutableInteger>hashMapFactory());
}
示例6: getMapFactory
import edu.stanford.nlp.util.MapFactory; //导入依赖的package包/类
public MapFactory<E, MutableInteger> getMapFactory() {
return ErasureUtils.<MapFactory<E,MutableInteger>>uncheckedCast(mapFactory);
}
示例7: getOuterMapFactory
import edu.stanford.nlp.util.MapFactory; //导入依赖的package包/类
public MapFactory<K1,ClassicCounter<K2>> getOuterMapFactory() {
return outerMF;
}
示例8: getInnerMapFactory
import edu.stanford.nlp.util.MapFactory; //导入依赖的package包/类
public MapFactory<K2,MutableDouble> getInnerMapFactory() {
return innerMF;
}
示例9: TwoDimensionalCounter
import edu.stanford.nlp.util.MapFactory; //导入依赖的package包/类
public TwoDimensionalCounter() {
this(MapFactory.<K1,ClassicCounter<K2>>hashMapFactory(), MapFactory.<K2,MutableDouble>hashMapFactory());
}
示例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());
}
示例11: ClassicCounterFactory
import edu.stanford.nlp.util.MapFactory; //导入依赖的package包/类
private ClassicCounterFactory(MapFactory<E,MutableDouble> mf) {
this.mf = mf;
}
示例12: getOuterMapFactory
import edu.stanford.nlp.util.MapFactory; //导入依赖的package包/类
public MapFactory<K1, ClassicCounter<K2>> getOuterMapFactory() {
return outerMF;
}
示例13: getInnerMapFactory
import edu.stanford.nlp.util.MapFactory; //导入依赖的package包/类
public MapFactory<K2, MutableDouble> getInnerMapFactory() {
return innerMF;
}
示例14: TwoDimensionalMap
import edu.stanford.nlp.util.MapFactory; //导入依赖的package包/类
public TwoDimensionalMap() {
this(MapFactory.<K1, Map<K2, V>>hashMapFactory(), MapFactory.<K2, V>hashMapFactory());
}
示例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());
}