Package org.omegat.core.segmentation
Class SRX
java.lang.Object
org.omegat.core.segmentation.SRX
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()booleanstatic SRXReturns the default SRX object with predefined settings.Returns all mapping rules (of classMapRule) at once: correspondences between languages and their segmentation rules.Returns segmentation support version.inthashCode()booleanGetter for property cascade.booleanGetter for property includeEndingTags.booleanGetter for property includeIsolatedTags.booleanGetter for property includeStartingTags.booleanGetter for property segmentSubflows.static @Nullable SRXloadFromDir(File configDir) Deprecated, for removal: This API element is subject to removal in a future version.lookupRulesForLanguage(Language srclang) Deprecated, for removal: This API element is subject to removal in a future version.static voidDeprecated, for removal: This API element is subject to removal in a future version.voidsetCascade(boolean cascade) Setter for property cascade.voidsetIncludeEndingTags(boolean includeEndingTags) Setter for property includeEndingTags.voidsetIncludeIsolatedTags(boolean includeIsolatedTags) Setter for property includeIsolatedTags.voidsetIncludeStartingTags(boolean includeStartingTags) Setter for property includeStartingTags.voidsetMappingRules(List<MapRule> rules) Sets all mapping rules (of classMapRule) at once: correspondences between languages and their segmentation rules.voidsetSegmentSubflows(boolean segmentSubflows) Setter for property segmentSubflows.voidsetVersion(String value) Sets segmentation support version.
-
Field Details
-
INITIAL_VERSION
Deprecated.Initial version of segmentation support (1.4.6 beta 4 -- 1.6.0 RC7).- See Also:
-
OT160RC8_VERSION
Deprecated.Segmentation support of 1.6.0 RC8 (a bit more rules added).- See Also:
-
OT160RC9_VERSION
Deprecated.Segmentation support of 1.6.0 RC9 (rules separated).- See Also:
-
CURRENT_VERSION
Deprecated.Currently supported segmentation support version.- See Also:
-
-
Constructor Details
-
SRX
public SRX()
-
-
Method Details
-
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 useSRXManager.saveToSrx(SRX, File)instead.- Parameters:
srx- the SRX object to be savedoutDir- the directory where the SRX file will be written- Throws:
IOException- if an I/O error occurs during saving
-
loadFromDir
Deprecated, for removal: This API element is subject to removal in a future version.Loads SRX rules from the specified directory. Please useSRXManager.loadFromDir(File)instead.- Parameters:
configDir- the directory containing SRX files- Returns:
- the loaded SRX object or null if loading fails
-
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 useSRXManager.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
Returns all mapping rules (of classMapRule) at once: correspondences between languages and their segmentation rules. -
setMappingRules
Sets all mapping rules (of classMapRule) at once: correspondences between languages and their segmentation rules. -
getVersion
Returns segmentation support version. -
setVersion
Sets segmentation support version. -
hashCode
public int hashCode() -
equals
-