Class ScriptClassifier

java.lang.Object
com.mta.tehreer.unicode.ScriptClassifier

public class ScriptClassifier extends Object
This class implements UAX #24 available at http://www.unicode.org/reports/tr24.
  • Constructor Details

    • ScriptClassifier

      public ScriptClassifier(@NonNull String text)
      Constructs a script classifier object for the specified text.
      Parameters:
      text - The text whose script classification is desired.
  • Method Details

    • getText

      @NonNull public String getText()
      Returns the text that the script classifier object was created for.
      Returns:
      The text that the script classifier object was created for.
    • getCharScripts

      @NonNull public IntList getCharScripts()
      Returns a list containing the resolved scripts of all characters in source text. The valid script values are available in Script class as static constants.
      Returns:
      A list containing the resolved scripts of all characters in source text.
    • getScriptRuns

      @NonNull public Iterator<ScriptRun> getScriptRuns()
      Returns an iterable of resolved script runs in source text.
      Returns:
      An iterable of resolved script runs in source text.
    • getScriptRuns

      @NonNull public Iterator<ScriptRun> getScriptRuns(int charStart, int charEnd)
      Returns an iterator of resolved script runs within the specified range of source text.
      Parameters:
      charStart - The index to the first character in source text.
      charEnd - The index after the last character in source text.
      Returns:
      An iterator of script runs within the specified range of source text.
    • toString

      @NonNull public String toString()
      Overrides:
      toString in class Object