本文整理汇总了Java中edu.berkeley.nlp.math.SloppyMath.isGreater方法的典型用法代码示例。如果您正苦于以下问题:Java SloppyMath.isGreater方法的具体用法?Java SloppyMath.isGreater怎么用?Java SloppyMath.isGreater使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类edu.berkeley.nlp.math.SloppyMath
的用法示例。
在下文中一共展示了SloppyMath.isGreater方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkScores
import edu.berkeley.nlp.math.SloppyMath; //导入方法依赖的package包/类
public void checkScores(Tree<StateSet> tree) {
StateSet node = tree.getLabel();
int state = node.getState();
int from = node.from, to = node.to;
int oldS = iScale[from][to][state];
int newS = ScalingTools.scaleArray(iScorePostU[from][to][state], oldS);
if (oldS > newS) {
System.out.println("why?? iscale");
}
oldS = oScale[from][to][state];
newS = ScalingTools.scaleArray(oScorePostU[from][to][state], oldS);
if (oldS > newS) {
ScalingTools.scaleArrayToScale(oScorePostU[from][to][state], newS,
oldS);
System.out.println("why?? oscale");
}
for (int substate = 0; substate < numSubStatesArray[state]; substate++) {
if ((node.getIScale() == iScale[from][to][state])
&& (!SloppyMath.isGreater(
iScorePostU[from][to][state][substate],
node.getIScore(substate)))) {
if (!allowedSubStates[from][to][state][substate])
System.out.println("This state was pruned!");
else {
System.out.println("Gold iScore is higher for state "
+ state + " from " + from + " to " + to + "!");
System.out.println("Gold " + node.getIScore(substate)
+ " all " + iScorePostU[from][to][state][substate]);
}
}
double tmpA = node.getOScore(substate);
double tmpB = oScorePostU[from][to][state][substate];
if ((node.getOScale() == oScale[from][to][state])
&& (!SloppyMath.isGreater(tmpB, tmpA))) {
if (!allowedSubStates[from][to][state][substate])
System.out.println("This state was pruned!");
else {
System.out.println("Gold oScore is higher for state "
+ state + " from " + from + " to " + to + "!");
System.out.println("Gold " + node.getOScore(substate)
+ " all " + oScorePostU[from][to][state][substate]);
}
}
}
for (Tree<StateSet> child : tree.getChildren()) {
if (!child.isLeaf())
checkScores(child);
}
}