public class SRX
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CONF_SENTSEG |
static java.lang.String |
CURRENT_VERSION
Currently supported segmentation support version.
|
static java.lang.String |
INITIAL_VERSION
Initial version of segmentation support (1.4.6 beta 4 -- 1.6.0 RC7).
|
static java.lang.String |
OT160RC8_VERSION
Segmentation support of 1.6.0 RC8 (a bit more rules added).
|
static java.lang.String |
OT160RC9_VERSION
Segmentation support of 1.6.0 RC9 (rules separated).
|
protected static javax.xml.bind.JAXBContext |
SRX_JAXB_CONTEXT
Context for JAXB rules processing.
|
Constructor and Description |
---|
SRX()
Creates an empty SRX, without any rules.
|
Modifier and Type | Method and Description |
---|---|
SRX |
copy() |
boolean |
equals(java.lang.Object obj) |
static SRX |
getDefault() |
java.util.List<MapRule> |
getMappingRules()
Returns all mapping rules (of class
MapRule ) at once:
correspondences between languages and their segmentation rules. |
java.lang.String |
getVersion()
Returns segmentation support version.
|
int |
hashCode() |
boolean |
isIncludeEndingTags()
Getter for property includeEndingTags.
|
boolean |
isIncludeIsolatedTags()
Getter for property includeIsolatedTags.
|
boolean |
isIncludeStartingTags()
Getter for property includeStartingTags.
|
boolean |
isSegmentSubflows()
Getter for property segmentSubflows.
|
static SRX |
loadSRX(java.io.File configFile)
Loads segmentation rules from an XML file.
|
java.util.List<Rule> |
lookupRulesForLanguage(Language srclang)
Finds the rules for a certain language.
|
static boolean |
projectConfigFileExists(java.lang.String configDir)
Does a config file already exists for the project at the given location?
|
static void |
saveTo(SRX srx,
java.io.File outFile)
Saves segmentation rules into specified file.
|
void |
setIncludeEndingTags(boolean includeEndingTags)
Setter for property includeEndingTags.
|
void |
setIncludeIsolatedTags(boolean includeIsolatedTags)
Setter for property includeIsolatedTags.
|
void |
setIncludeStartingTags(boolean includeStartingTags)
Setter for property includeStartingTags.
|
void |
setMappingRules(java.util.List<MapRule> rules)
Sets all mapping rules (of class
MapRule ) at once:
correspondences between languages and their segmentation rules. |
void |
setSegmentSubflows(boolean segmentSubflows)
Setter for property segmentSubflows.
|
void |
setVersion(java.lang.String value)
Sets segmentation support version.
|
public static final java.lang.String CONF_SENTSEG
protected static final javax.xml.bind.JAXBContext SRX_JAXB_CONTEXT
public static final java.lang.String INITIAL_VERSION
public static final java.lang.String OT160RC8_VERSION
public static final java.lang.String OT160RC9_VERSION
public static final java.lang.String CURRENT_VERSION
public SRX()
Please do not call directly unless you know what you are doing.
public SRX copy()
public static void saveTo(SRX srx, java.io.File outFile) throws java.io.IOException
java.io.IOException
public static SRX loadSRX(java.io.File configFile)
initDefaults
.
Since 1.6.0 RC8 it also checks if the version of segmentation rules saved is older than that of the current OmegaT, and tries to merge the two sets of rules.
public static boolean projectConfigFileExists(java.lang.String configDir)
configDir
- the project directory for storage of settings filepublic static SRX getDefault()
public java.util.List<Rule> lookupRulesForLanguage(Language srclang)
Usually (if the user didn't screw up the setup) there're a default segmentation rules, so it's a good idea to rely on this method always returning at least some rules.
Or in case of a completely screwed setup -- an empty list without any rules.
public boolean isSegmentSubflows()
public void setSegmentSubflows(boolean segmentSubflows)
segmentSubflows
- New value of property segmentSubflows.public boolean isIncludeStartingTags()
public void setIncludeStartingTags(boolean includeStartingTags)
includeStartingTags
- New value of property includeStartingTags.public boolean isIncludeEndingTags()
public void setIncludeEndingTags(boolean includeEndingTags)
includeEndingTags
- New value of property includeEndingTags.public boolean isIncludeIsolatedTags()
public void setIncludeIsolatedTags(boolean includeIsolatedTags)
includeIsolatedTags
- New value of property includeIsolatedTags.public java.util.List<MapRule> getMappingRules()
MapRule
) at once:
correspondences between languages and their segmentation rules.public void setMappingRules(java.util.List<MapRule> rules)
MapRule
) at once:
correspondences between languages and their segmentation rules.public java.lang.String getVersion()
public void setVersion(java.lang.String value)
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object