001    package calhoun.analysis.crf;
002    
003    import calhoun.analysis.crf.io.TrainingSequence;
004    
005    /** interface for local scoring functions used by the local score gradient functions.
006     * The alternate objective functions that use a local similarity score to calculate use this
007     * interface to access the local scoring functions.
008     */
009    public interface LocalPathSimilarityScore {
010            
011            /** compute a real-valued score between a given path and the true path at a given position. 
012             * 
013             * @param yprev         the hidden state at the previous position in this path
014             * @param y                     the hidden state at the current position in this path
015             * @param seq           the training sequence containing the input and the true path
016             * @param pos           the position at which the score is to be calculated
017             * @return the similarity score computed at this position for this path
018             */
019            public double evaluate(int yprev, int y, TrainingSequence<?> seq, int pos);
020    }