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


Java MatchMismatch类代码示例

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


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

示例1: getSmithWatermanFunction

import org.simmetrics.metrics.functions.MatchMismatch; //导入依赖的package包/类
private org.simmetrics.metrics.SmithWaterman getSmithWatermanFunction(final Value... values) throws ExpressionEvaluationException {
    if (smithWaterman == null) {
        if (values.length == 7) {
            for(final Expression expression : getArgs()) {
                if(!(expression instanceof Constant)) {
                    throw new ExpressionEvaluationException("Parameters 2 through 7 must be constant expressions");
                }
            }
            final float gapA = assertNumericLiteral(values[2]).floatValue();
            final float gapB = assertNumericLiteral(values[3]).floatValue();
            
            final float subPenaltyA = assertNumericLiteral(values[4]).floatValue();
            final float subPenaltyB = assertNumericLiteral(values[5]).floatValue();
            
            final int windowSize = assertNumericLiteral(values[6]).intValue();
            
            smithWaterman = new org.simmetrics.metrics.SmithWaterman(new AffineGap(gapA, gapB), new MatchMismatch(subPenaltyA, subPenaltyB), windowSize);
        } else {
            smithWaterman = new org.simmetrics.metrics.SmithWaterman();
        }
    }
    return smithWaterman;
}
 
开发者ID:semantalytics,项目名称:stardog-plugin-string-similarity,代码行数:24,代码来源:SmithWaterman.java

示例2: getSmithWatermanGotohFunction

import org.simmetrics.metrics.functions.MatchMismatch; //导入依赖的package包/类
private org.simmetrics.metrics.SmithWatermanGotoh getSmithWatermanGotohFunction(final Value... values) throws ExpressionEvaluationException {
    if (smithWatermanGotoh == null) {
        if (values.length == 5) {
            for (final Expression expression : getArgs()) {
                //FIXME check only 2 through 7 not all params
                if (!(expression instanceof Constant)) {
                    throw new ExpressionEvaluationException("Parameters 2 through 7 must be constant expressions");
                }
            }
            
            final float gapValue = assertNumericLiteral(values[2]).floatValue();
            final float matchPenalty = assertNumericLiteral(values[3]).floatValue();
            final float mismatchPenalty = assertNumericLiteral(values[4]).floatValue();
            
            smithWatermanGotoh = new org.simmetrics.metrics.SmithWatermanGotoh(gapValue, new MatchMismatch(matchPenalty, mismatchPenalty));
        } else {
            smithWatermanGotoh = new org.simmetrics.metrics.SmithWatermanGotoh();
        }
    }
    return smithWatermanGotoh;
}
 
开发者ID:semantalytics,项目名称:stardog-plugin-string-similarity,代码行数:22,代码来源:SmithWatermanGotoh.java

示例3: getNeedlemanWunchFunction

import org.simmetrics.metrics.functions.MatchMismatch; //导入依赖的package包/类
private org.simmetrics.metrics.NeedlemanWunch getNeedlemanWunchFunction(final Value... values) throws ExpressionEvaluationException {
    if (needlemanWunch == null) {
        if (values.length == 5) {
            
            final float gapValue = assertNumericLiteral(values[2]).floatValue();
            final float subPenaltyA = assertNumericLiteral(values[3]).floatValue();
            final float subPenaltyB = assertNumericLiteral(values[4]).floatValue();
            
            needlemanWunch = new org.simmetrics.metrics.NeedlemanWunch(gapValue, new MatchMismatch(subPenaltyA, subPenaltyB));
        } else {
            needlemanWunch = new org.simmetrics.metrics.NeedlemanWunch();
        }
    }
    return needlemanWunch;
}
 
开发者ID:semantalytics,项目名称:stardog-plugin-string-similarity,代码行数:16,代码来源:NeedlemanWunch.java

示例4: SmithWaterman

import org.simmetrics.metrics.functions.MatchMismatch; //导入依赖的package包/类
/**
 * Constructs a new Smith Waterman metric. Uses an affine gap of
 * <code>-5.0 - gapLength</code> a <code>-3.0</code> substitution penalty
 * for mismatches, <code>5.0</code> for matches.
 * 
 */
public SmithWaterman() {
	this(new AffineGap(-5.0f, -1.0f), new MatchMismatch(5.0f, -3.0f),
			Integer.MAX_VALUE);
}
 
开发者ID:janmotl,项目名称:linkifier,代码行数:11,代码来源:SmithWaterman.java


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