Search in sources :

Example 11 with ShapeInSequence

use of com.joliciel.jochre.boundaries.ShapeInSequence in project jochre by urieli.

the class LastShapeInSequenceFeature method checkInternal.

@Override
public FeatureResult<Boolean> checkInternal(ShapeInSequenceWrapper wrapper, RuntimeEnvironment env) {
    ShapeInSequence shapeInSequence = wrapper.getShapeInSequence();
    boolean result = (shapeInSequence.getShapeSequence().size() == (shapeInSequence.getIndex() + 1));
    FeatureResult<Boolean> outcome = this.generateResult(result);
    return outcome;
}
Also used : ShapeInSequence(com.joliciel.jochre.boundaries.ShapeInSequence)

Example 12 with ShapeInSequence

use of com.joliciel.jochre.boundaries.ShapeInSequence in project jochre by urieli.

the class ShapeReverseIndexFeature method checkInternal.

@Override
public FeatureResult<Integer> checkInternal(ShapeInSequenceWrapper wrapper, RuntimeEnvironment env) {
    ShapeInSequence shapeInSequence = wrapper.getShapeInSequence();
    FeatureResult<Integer> outcome = null;
    int reverseIndex = shapeInSequence.getShapeSequence().size() - (shapeInSequence.getIndex() + 1);
    if (reverseIndex <= 1) {
        outcome = this.generateResult(reverseIndex);
    }
    return outcome;
}
Also used : ShapeInSequence(com.joliciel.jochre.boundaries.ShapeInSequence)

Aggregations

ShapeInSequence (com.joliciel.jochre.boundaries.ShapeInSequence)12 Shape (com.joliciel.jochre.graphics.Shape)5 ArrayList (java.util.ArrayList)5 ShapeSequence (com.joliciel.jochre.boundaries.ShapeSequence)4 GroupOfShapes (com.joliciel.jochre.graphics.GroupOfShapes)4 Linguistics (com.joliciel.jochre.lang.Linguistics)2 LetterSequence (com.joliciel.jochre.letterGuesser.LetterSequence)2 Paragraph (com.joliciel.jochre.graphics.Paragraph)1 RowOfShapes (com.joliciel.jochre.graphics.RowOfShapes)1 JochreException (com.joliciel.jochre.utils.JochreException)1 Decision (com.joliciel.talismane.machineLearning.Decision)1 BufferedWriter (java.io.BufferedWriter)1 IOException (java.io.IOException)1 OutputStreamWriter (java.io.OutputStreamWriter)1 Writer (java.io.Writer)1 List (java.util.List)1 PriorityQueue (java.util.PriorityQueue)1 TreeMap (java.util.TreeMap)1