當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。