Class ContextualRule

    • Constructor Summary

      Constructors 
      Constructor Description
      ContextualRule()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      int getBacktrackContextLength()
      Gets the length of the backtrack context glyph sequence defined by this rule
      abstract int getContextLength()
      Gets the length of the context glyph sequence defined by this rule
      int getLookaheadContextLength()
      Gets the length of the lookahead context glyph sequence defined by this rule
      boolean isGlyphMatchesBacktrack​(int glyphId, int atIdx)
      Checks if glyph line element matches element from backtrack sequence of the rule.
      abstract boolean isGlyphMatchesInput​(int glyphId, int atIdx)
      Checks if glyph line element matches element from input sequence of the rule.
      boolean isGlyphMatchesLookahead​(int glyphId, int atIdx)
      Checks if glyph line element matches element from lookahead sequence of the rule.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ContextualRule

        public ContextualRule()
    • Method Detail

      • getContextLength

        public abstract int getContextLength()
        Gets the length of the context glyph sequence defined by this rule
        Returns:
        length of the context
      • isGlyphMatchesInput

        public abstract boolean isGlyphMatchesInput​(int glyphId,
                                                    int atIdx)
        Checks if glyph line element matches element from input sequence of the rule.

        NOTE: rules do not contain the first element of the input sequence, the first element is defined by rule position in substitution table. Therefore atIdx shall not be 0.
        Parameters:
        glyphId - glyph code id
        atIdx - index in the rule sequence. Shall be: 0 < atIdx < getContextLength()
        Returns:
        true if glyph matches element
      • getLookaheadContextLength

        public int getLookaheadContextLength()
        Gets the length of the lookahead context glyph sequence defined by this rule
        Returns:
        length of the lookahead context
      • getBacktrackContextLength

        public int getBacktrackContextLength()
        Gets the length of the backtrack context glyph sequence defined by this rule
        Returns:
        length of the backtrack context
      • isGlyphMatchesLookahead

        public boolean isGlyphMatchesLookahead​(int glyphId,
                                               int atIdx)
        Checks if glyph line element matches element from lookahead sequence of the rule.
        Parameters:
        glyphId - glyph code id
        atIdx - index in rule sequence. Shall be: 0 <= atIdx < getLookaheadContextLength()
        Returns:
        true if glyph matches element from lookahead sequence
      • isGlyphMatchesBacktrack

        public boolean isGlyphMatchesBacktrack​(int glyphId,
                                               int atIdx)
        Checks if glyph line element matches element from backtrack sequence of the rule.
        Parameters:
        glyphId - glyph code id
        atIdx - index in rule sequence. Shall be: 0 <= atIdx < getBacktrackContextLength()
        Returns:
        true if glyph matches element from backtrack sequence