Class CharacterCounter


  • public class CharacterCounter
    extends BaseCounter
    Character Count engine. Contains static methods to calculate number of characters in a given text fragment.
    • Constructor Detail

      • CharacterCounter

        public CharacterCounter()
    • Method Detail

      • count

        public static long count​(Object text,
                                 LocaleId language)
      • getCount

        public static long getCount​(ITextUnit tu)
        Returns the character count information stored by CharacterCountStep in the source part of a given text unit.
        Parameters:
        tu - the given text unit
        Returns:
        number of characters (0 if no character count information found)
      • getCount

        public static long getCount​(ITextUnit tu,
                                    int segIndex)
        Returns the character count information stored by CharacterCountStep in a given segment of the source part of a given text unit.
        Parameters:
        tu - the given tu
        segIndex - index of the segment in the source
        Returns:
        number of characters (0 if no character count information found)
      • getCount

        public static long getCount​(Segment segment)
        Returns the character count information stored by CharacterCountStep in a given segment of the source part of a given text unit.
        Parameters:
        segment - the given segment
        Returns:
        number of characters (0 if no character count information found)