Package org.omegat.core.segmentation
Class Rule
- java.lang.Object
-
- org.omegat.core.segmentation.Rule
-
- All Implemented Interfaces:
java.io.Serializable
public class Rule extends java.lang.Object implements java.io.SerializableThe class representing a single segmentation rule.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Rulecopy()booleanequals(java.lang.Object obj)Indicates whether some other Rule is "equal to" this one.java.lang.StringgetAfterbreak()Returns a regular expression which represents the text that appears after a segment break.java.lang.StringgetBeforebreak()Returns a regular expression which represents the text that appears before a segment break.java.util.regex.PatterngetCompiledAfterbreak()Returns a regular expression which represents the text that appears after a segment break.java.util.regex.PatterngetCompiledBeforebreak()Returns a regular expression which represents the text that appears before a segment break.inthashCode()Returns a hash code value for the object.booleanisBreakRule()Returns whether this is a rule that determines a break or an exception.voidsetAfterbreak(java.lang.String afterbreak)Sets a regular expression which represents the text that appears after a segment break.voidsetBeforebreak(java.lang.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.java.lang.StringtoString()Returns a string representation of the Rule for debugging purposes.
-
-
-
Method Detail
-
copy
public Rule 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
public java.lang.String getBeforebreak()
Returns a regular expression which represents the text that appears before a segment break.- Returns:
- regular expression of a text before break.
-
getCompiledBeforebreak
public java.util.regex.Pattern getCompiledBeforebreak()
Returns a regular expression which represents the text that appears before a segment break.- Returns:
- regular expression of a text before break.
-
setBeforebreak
public void setBeforebreak(java.lang.String beforebreak) throws java.util.regex.PatternSyntaxExceptionSets a regular expression which represents the text that appears before a segment break.- Parameters:
beforebreak- Regular expression string of a text before break.- Throws:
java.util.regex.PatternSyntaxException
-
getAfterbreak
public java.lang.String getAfterbreak()
Returns a regular expression which represents the text that appears after a segment break.- Returns:
- regular expression of a text after break.
-
getCompiledAfterbreak
public java.util.regex.Pattern getCompiledAfterbreak()
Returns a regular expression which represents the text that appears after a segment break.- Returns:
- regular expression of a text after break.
-
setAfterbreak
public void setAfterbreak(java.lang.String afterbreak) throws java.util.regex.PatternSyntaxExceptionSets a regular expression which represents the text that appears after a segment break.- Parameters:
afterbreak- Regular expression string of a text after break.- Throws:
java.util.regex.PatternSyntaxException
-
equals
public boolean equals(java.lang.Object obj)
Indicates whether some other Rule is "equal to" this one.- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
Returns a hash code value for the object.- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
Returns a string representation of the Rule for debugging purposes.- Overrides:
toStringin classjava.lang.Object
-
-