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.Serializable
The class representing a single segmentation rule.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Rule
copy()
boolean
equals(java.lang.Object obj)
Indicates whether some other Rule is "equal to" this one.java.lang.String
getAfterbreak()
Returns a regular expression which represents the text that appears after a segment break.java.lang.String
getBeforebreak()
Returns a regular expression which represents the text that appears before a segment break.java.util.regex.Pattern
getCompiledAfterbreak()
Returns a regular expression which represents the text that appears after a segment break.java.util.regex.Pattern
getCompiledBeforebreak()
Returns a regular expression which represents the text that appears before a segment break.int
hashCode()
Returns a hash code value for the object.boolean
isBreakRule()
Returns whether this is a rule that determines a break or an exception.void
setAfterbreak(java.lang.String afterbreak)
Sets a regular expression which represents the text that appears after a segment break.void
setBeforebreak(java.lang.String beforebreak)
Sets a regular expression which represents the text that appears before a segment break.void
setBreakRule(boolean breakRule)
Sets whether this is a rule that determines a break or an exception.java.lang.String
toString()
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.PatternSyntaxException
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:
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.PatternSyntaxException
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:
java.util.regex.PatternSyntaxException
-
equals
public boolean equals(java.lang.Object obj)
Indicates whether some other Rule is "equal to" this one.- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
Returns a hash code value for the object.- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
Returns a string representation of the Rule for debugging purposes.- Overrides:
toString
in classjava.lang.Object
-
-