Package org.omegat.core.segmentation
Class Rule
java.lang.Object
org.omegat.core.segmentation.Rule
The class representing a single segmentation rule.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()booleanIndicates whether some other Rule is "equal to" this one.Returns a regular expression which represents the text that appears after a segment break.Returns a regular expression which represents the text that appears before a segment break.Returns a regular expression which represents the text that appears after a segment break.Returns a regular expression which represents the text that appears before a segment break.inthashCode()Returns a hash code value for the object.booleanReturns whether this is a rule that determines a break or an exception.voidsetAfterbreak(String afterbreak) Sets a regular expression which represents the text that appears after a segment break.voidsetBeforebreak(String beforebreak) Sets a regular expression which represents the text that appears before a segment break.voidsetBreakRule(boolean breakRule) Sets whether this is a rule that determines a break or an exception.toString()Returns a string representation of the Rule for debugging purposes.
-
Constructor Details
-
Rule
public Rule()Creates a new empty instance of segmentation rule -
Rule
Creates an initialized instance of segmentation rule -
Rule
-
-
Method Details
-
copy
-
isBreakRule
public boolean isBreakRule()Returns whether this is a rule that determines a break or an exception.- Returns:
- true is this is a break rule.
-
setBreakRule
public void setBreakRule(boolean breakRule) Sets whether this is a rule that determines a break or an exception.- Parameters:
breakRule- New value -- true for a break rule, false for an exception.
-
getBeforebreak
Returns a regular expression which represents the text that appears before a segment break.- Returns:
- regular expression of a text before break.
-
getCompiledBeforebreak
Returns a regular expression which represents the text that appears before a segment break.- Returns:
- regular expression of a text before break.
-
setBeforebreak
Sets a regular expression which represents the text that appears before a segment break.- Parameters:
beforebreak- Regular expression string of a text before break.- Throws:
PatternSyntaxException
-
getAfterbreak
Returns a regular expression which represents the text that appears after a segment break.- Returns:
- regular expression of a text after break.
-
getCompiledAfterbreak
Returns a regular expression which represents the text that appears after a segment break.- Returns:
- regular expression of a text after break.
-
setAfterbreak
Sets a regular expression which represents the text that appears after a segment break.- Parameters:
afterbreak- Regular expression string of a text after break.- Throws:
PatternSyntaxException
-
equals
Indicates whether some other Rule is "equal to" this one. -
hashCode
public int hashCode()Returns a hash code value for the object. -
toString
Returns a string representation of the Rule for debugging purposes.
-