Class IndicLigaturizer

  • All Implemented Interfaces:
    LanguageProcessor
    Direct Known Subclasses:
    DevanagariLigaturizer, GujaratiLigaturizer

    public abstract class IndicLigaturizer
    extends java.lang.Object
    implements LanguageProcessor
    Superclass for processors that can convert a String of bytes in an Indic language to a String in the same language of which the bytes are reordered for rendering using a font that contains the necessary glyphs.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isRTL()
      Indic languages are written from right to left.
      protected boolean IsSwaraLetter​(char ch)
      Checks if a character is vowel letter.
      protected boolean IsSwaraMatra​(char ch)
      Checks if a character is vowel sign.
      protected boolean IsVyanjana​(char ch)
      Checks if a character is consonant letter.
      java.lang.String process​(java.lang.String s)
      Reorders the bytes in a String making Indic ligatures
      private static void swap​(java.lang.StringBuilder s, int i, int j)
      Swaps two characters in a StringBuilder object
      • Methods inherited from class java.lang.Object

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

      • IndicLigaturizer

        public IndicLigaturizer()
    • Method Detail

      • process

        public java.lang.String process​(java.lang.String s)
        Reorders the bytes in a String making Indic ligatures
        Specified by:
        process in interface LanguageProcessor
        Parameters:
        s - the original String
        Returns:
        the ligaturized String
      • IsSwaraLetter

        protected boolean IsSwaraLetter​(char ch)
        Checks if a character is vowel letter.
        Parameters:
        ch - the character that needs to be checked
        Returns:
        true if the characters is a vowel letter
      • IsSwaraMatra

        protected boolean IsSwaraMatra​(char ch)
        Checks if a character is vowel sign.
        Parameters:
        ch - the character that needs to be checked
        Returns:
        true if the characters is a vowel sign
      • IsVyanjana

        protected boolean IsVyanjana​(char ch)
        Checks if a character is consonant letter.
        Parameters:
        ch - the character that needs to be checked
        Returns:
        true if the chracter is a consonant letter
      • swap

        private static void swap​(java.lang.StringBuilder s,
                                 int i,
                                 int j)
        Swaps two characters in a StringBuilder object
        Parameters:
        s - the StringBuilder
        i - the index of one character
        j - the index of the other character