Class MapRule

java.lang.Object
org.omegat.core.segmentation.MapRule

public class MapRule extends Object
A class representing the language rules and their mapping to the segmentation rules for each particular language.
  • Constructor Details

    • MapRule

      public MapRule(String language, String pattern, List<Rule> rules)
      Create initialized MapRule object.
      Parameters:
      language - localized language name (from segmentation.conf), or language code (from SRX)
      pattern - language pattern such as "EN.*" or ".*"
      rules - segmentation rules.
    • MapRule

      public MapRule(Languagemap languagemap, List<Rule> rules)
      Create initialized MapRule object from segmentation.srx.
      Parameters:
      languagemap - language map from segmentation.srx.
      rules - segmentation rules.
  • Method Details

    • getLanguageName

      public String getLanguageName()
      Returns Language Name (to display it in a dialog).
    • getLanguage

      public String getLanguage()
      Returns Language Code for programmatic usage.
    • getPattern

      public String getPattern()
      Returns Pattern for the language/country ISO code (of a form LL-CC).
    • getCompiledPattern

      public Pattern getCompiledPattern()
      Returns Compiled Pattern for the language/country ISO code (of a form LL-CC).
    • copy

      public MapRule copy()
      Copy of the object.
      Returns:
      new MapRule object
    • getRules

      public List<Rule> getRules()
      Returns List of rules (of class Rule) for the language
    • equals

      public boolean equals(Object obj)
      Indicates whether some other MapRule is "equal to" this one.
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Returns a hash code value for the object.
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Returns a string representation of the MapRule for debugging purposes.
      Overrides:
      toString in class Object