Package net.sf.okapi.lib.verification
Class PatternItem
- java.lang.Object
-
- net.sf.okapi.lib.verification.PatternItem
-
public class PatternItem extends Object
-
-
Field Summary
Fields Modifier and Type Field Description StringdescriptionbooleanenabledbooleanfromSourcestatic StringSAMEintseveritybooleansinglePatternStringsourceStringtarget
-
Constructor Summary
Constructors Constructor Description PatternItem(String source, String target, boolean enabled, int severity)PatternItem(String source, String target, boolean enabled, int severity, boolean fromSource, String message)PatternItem(String source, String target, boolean enabled, int severity, String message)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcompile()PatterngetSourcePattern()PatterngetSourceSmartPattern(Matcher trgMatcher)Gets the pattern object for the source, automatically compiling a new one if it is null (which means the pattern contains the keyword "" and/or $N). PatterngetTargetPattern()PatterngetTargetSmartPattern(Matcher srcMatcher)Gets the pattern object for the target, automatically compiling a new one if it is null (which means the pattern contains the keyword "" and/or $N). static List<PatternItem>loadFile(String path)static List<PatternItem>saveFile(String path, List<PatternItem> list)
-
-
-
Field Detail
-
SAME
public static final String SAME
- See Also:
- Constant Field Values
-
source
public String source
-
target
public String target
-
enabled
public boolean enabled
-
description
public String description
-
severity
public int severity
-
fromSource
public boolean fromSource
-
singlePattern
public boolean singlePattern
-
-
Method Detail
-
loadFile
public static List<PatternItem> loadFile(String path)
-
saveFile
public static List<PatternItem> saveFile(String path, List<PatternItem> list)
-
compile
public void compile()
-
getSourcePattern
public Pattern getSourcePattern()
-
getTargetPattern
public Pattern getTargetPattern()
-
getTargetSmartPattern
public Pattern getTargetSmartPattern(Matcher srcMatcher)
Gets the pattern object for the target, automatically compiling a new one if it is null (which means the pattern contains the keyword "" and/or $N). - Parameters:
srcMatcher- the source Matcher object (for accessing the captured groups)- Returns:
- the pattern to use.
-
getSourceSmartPattern
public Pattern getSourceSmartPattern(Matcher trgMatcher)
Gets the pattern object for the source, automatically compiling a new one if it is null (which means the pattern contains the keyword "" and/or $N). - Parameters:
trgMatcher- the source Matcher object (for accessing the captured groups)- Returns:
- the pattern to use.
-
-