本文整理汇总了Java中cc.mallet.fst.Transducer.State.getIndex方法的典型用法代码示例。如果您正苦于以下问题:Java State.getIndex方法的具体用法?Java State.getIndex怎么用?Java State.getIndex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cc.mallet.fst.Transducer.State
的用法示例。
在下文中一共展示了State.getIndex方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getXiProbability
import cc.mallet.fst.Transducer.State; //导入方法依赖的package包/类
public double getXiProbability (int ip, State s1, State s2) {
if (xis == null)
throw new IllegalStateException ("xis were not saved.");
int i = s1.getIndex ();
int j = s2.getIndex ();
return Math.exp (xis[ip][i][j]);
}
示例2: getXiWeight
import cc.mallet.fst.Transducer.State; //导入方法依赖的package包/类
public double getXiWeight(int ip, State s1, State s2)
{
if (xis == null)
throw new IllegalStateException ("xis were not saved.");
int i = s1.getIndex ();
int j = s2.getIndex ();
return xis[ip][i][j];
}
示例3: getXiProbability
import cc.mallet.fst.Transducer.State; //导入方法依赖的package包/类
public double getXiProbability(int ip, State s1, State s2) {
if (xis == null)
throw new IllegalStateException("xis were not saved.");
int i = s1.getIndex();
int j = s2.getIndex();
return Math.exp(xis[ip][i][j]);
}
示例4: getXiWeight
import cc.mallet.fst.Transducer.State; //导入方法依赖的package包/类
public double getXiWeight(int ip, State s1, State s2) {
if (xis == null)
throw new IllegalStateException("xis were not saved.");
int i = s1.getIndex();
int j = s2.getIndex();
return xis[ip][i][j];
}
示例5: getCache
import cc.mallet.fst.Transducer.State; //导入方法依赖的package包/类
private WeightCache getCache(int position) {
WeightCache cache = caches[position];
if (cache == null) { // No cache for this position
// System.out.println("cache " + numCaches + "/" + maxCaches);
if (numCaches < maxCaches) { // Create another cache
cache = new WeightCache(position);
if (numCaches++ == 0)
first = last = cache;
}
else { // Steal least used cache
cache = last;
caches[cache.position] = null;
cache.init(position);
}
for (int i = 0; i < t.numStates(); i++) {
if (lattice[position][i] == null || lattice[position][i].delta == Transducer.IMPOSSIBLE_WEIGHT)
continue;
State s = t.getState(i);
TransitionIterator iter =
s.transitionIterator (input, position, providedOutput, position);
while (iter.hasNext()) {
State d = iter.next();
cache.weight[i][d.getIndex()] = iter.getWeight();
}
}
caches[position] = cache;
}
if (cache != first) { // Move to front
if (cache == last)
last = cache.prev;
if (cache.prev != null)
cache.prev.next = cache.next;
cache.next = first;
cache.prev = null;
first.prev = cache;
first = cache;
}
return cache;
}
示例6: getXiWeight
import cc.mallet.fst.Transducer.State; //导入方法依赖的package包/类
public double getXiWeight(int ip, State s1, State s2) {
if (xis == null)
throw new IllegalStateException("xis were not saved.");
int i = s1.getIndex();
int j = s2.getIndex();
return xis[ip][i][j];
}
示例7: getXiProbability
import cc.mallet.fst.Transducer.State; //导入方法依赖的package包/类
public double getXiProbability (int ip, State s1, State s2) {
if (xis == null)
throw new IllegalStateException ("xis were not saved.");
int i = s1.getIndex ();
int j = s2.getIndex ();
return Math.exp (xis[ip][i][j]);
}
示例8: getXiWeight
import cc.mallet.fst.Transducer.State; //导入方法依赖的package包/类
public double getXiWeight (int ip, State s1, State s2)
{
if (xis == null)
throw new IllegalStateException ("xis were not saved.");
int i = s1.getIndex ();
int j = s2.getIndex ();
return xis[ip][i][j];
}
示例9: getGammaWeight
import cc.mallet.fst.Transducer.State; //导入方法依赖的package包/类
public double getGammaWeight(int inputPosition, State s) {
return gammas[inputPosition][s.getIndex()]; }
示例10: getGammaWeight
import cc.mallet.fst.Transducer.State; //导入方法依赖的package包/类
public double getGammaWeight(int inputPosition, State s) {
return gammas[inputPosition][s.getIndex()];
}
示例11: getGammaWeight
import cc.mallet.fst.Transducer.State; //导入方法依赖的package包/类
public double getGammaWeight (int inputPosition, State s) {
return gammas[inputPosition][s.getIndex()]; }