Class SRX

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

public class SRX extends Object
The class with all the segmentation data possible -- rules, languages, etc. It loads and saves its data from/to the SRX file.

When creating an SRX object with the default constructor, you get an empty SRX without any rules. Please do not use default constructor, unless you know what you are doing.

  • Field Details

  • Constructor Details

    • SRX

      public SRX()
  • Method Details

    • copy

      public SRX copy()
    • saveToSrx

      @Deprecated(forRemoval=true, since="6.1.0") public static void saveToSrx(@Nullable SRX srx, File outDir) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Saves the given SRX object to the specified directory. Please use SRXManager.saveToSrx(SRX, File) instead.
      Parameters:
      srx - the SRX object to be saved
      outDir - the directory where the SRX file will be written
      Throws:
      IOException - if an I/O error occurs during saving
    • loadFromDir

      @Deprecated(forRemoval=true, since="6.1.0") public static @Nullable SRX loadFromDir(File configDir)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Loads SRX rules from the specified directory. Please use SRXManager.loadFromDir(File) instead.
      Parameters:
      configDir - the directory containing SRX files
      Returns:
      the loaded SRX object or null if loading fails
    • getDefault

      public static SRX getDefault()
      Returns the default SRX object with predefined settings.
      Returns:
      the default SRX object
    • lookupRulesForLanguage

      @Deprecated(forRemoval=true, since="6.1.0") public List<Rule> lookupRulesForLanguage(Language srclang)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns all segmentation rules for the given source language. Please use SRXManager.lookupRulesForLanguage(SRX, Language) instead.
      Parameters:
      srclang - the source language
      Returns:
      list of segmentation rules for the specified language
    • isCascade

      public boolean isCascade()
      Getter for property cascade.
      Returns:
      Value of property cascade.
    • setCascade

      public void setCascade(boolean cascade)
      Setter for property cascade.
      Parameters:
      cascade - New value of property cascade.
    • isSegmentSubflows

      public boolean isSegmentSubflows()
      Getter for property segmentSubflows.
      Returns:
      Value of property segmentSubflows.
    • setSegmentSubflows

      public void setSegmentSubflows(boolean segmentSubflows)
      Setter for property segmentSubflows.
      Parameters:
      segmentSubflows - New value of property segmentSubflows.
    • isIncludeStartingTags

      public boolean isIncludeStartingTags()
      Getter for property includeStartingTags.
      Returns:
      Value of property includeStartingTags.
    • setIncludeStartingTags

      public void setIncludeStartingTags(boolean includeStartingTags)
      Setter for property includeStartingTags.
      Parameters:
      includeStartingTags - New value of property includeStartingTags.
    • isIncludeEndingTags

      public boolean isIncludeEndingTags()
      Getter for property includeEndingTags.
      Returns:
      Value of property includeEndingTags.
    • setIncludeEndingTags

      public void setIncludeEndingTags(boolean includeEndingTags)
      Setter for property includeEndingTags.
      Parameters:
      includeEndingTags - New value of property includeEndingTags.
    • isIncludeIsolatedTags

      public boolean isIncludeIsolatedTags()
      Getter for property includeIsolatedTags.
      Returns:
      Value of property includeIsolatedTags.
    • setIncludeIsolatedTags

      public void setIncludeIsolatedTags(boolean includeIsolatedTags)
      Setter for property includeIsolatedTags.
      Parameters:
      includeIsolatedTags - New value of property includeIsolatedTags.
    • getMappingRules

      public List<MapRule> getMappingRules()
      Returns all mapping rules (of class MapRule) at once: correspondences between languages and their segmentation rules.
    • setMappingRules

      public void setMappingRules(List<MapRule> rules)
      Sets all mapping rules (of class MapRule) at once: correspondences between languages and their segmentation rules.
    • getVersion

      public String getVersion()
      Returns segmentation support version.
    • setVersion

      public void setVersion(String value)
      Sets segmentation support version.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object