org.cogroo.tools.checker.rules.util
Class RuleUtils
java.lang.Object
org.cogroo.tools.checker.rules.util.RuleUtils
public class RuleUtils
- extends Object
Set of utility methods, mostly to convert a rule element to a human readable string.
- Author:
- Marcelo Suzumura, William Colen
Method Summary |
static void |
completeMissingParts(TagMask tagMask,
MorphologicalTag tag)
|
static TagMask |
createTagMaskFromReference(Reference ref,
MorphologicalTag mTag,
ChunkTag cTag,
SyntacticTag sTag)
|
static TagMask |
createTagMaskFromReference(Reference ref,
Sentence sent,
int refPos)
|
static TagMask |
createTagMaskFromReferenceSyntatic(Reference ref,
Sentence sent,
int refPos)
|
static String |
getBoundariesAsString(Rule rule)
|
static String |
getElementAsString(Element element)
Gets the string representation of an element. |
static String |
getGroupAsString(Rule rule)
|
static String |
getMessageAsString(Rule rule)
|
static String |
getMethodAsString(Rule rule)
|
static String |
getPatternAsString(Rule rule)
|
static String |
getPatternElementAsString(PatternElement patternElement)
|
static Map<RuleUtils.RuleInfo,String> |
getRuleAsString(Rule rule)
|
static String |
getShortMessageAsString(Rule rule)
|
static String |
getSuggestionsAsString(Rule rule)
|
static String |
getTagMaskAsString(TagMask tagMask)
|
static String |
getTagReferenceAsString(Reference tagRef)
|
static String |
getTypeAsString(Rule rule)
|
static String |
translate(String ori)
|
static String |
useCasedString(String replaceable,
String replacement)
Checks the case of the first char from replaceable and changes the first char from the
replacement accordingly. |
RuleUtils
public RuleUtils()
getRuleAsString
public static Map<RuleUtils.RuleInfo,String> getRuleAsString(Rule rule)
getMethodAsString
public static String getMethodAsString(Rule rule)
getTypeAsString
public static String getTypeAsString(Rule rule)
getGroupAsString
public static String getGroupAsString(Rule rule)
getMessageAsString
public static String getMessageAsString(Rule rule)
getShortMessageAsString
public static String getShortMessageAsString(Rule rule)
getPatternAsString
public static String getPatternAsString(Rule rule)
getPatternElementAsString
public static String getPatternElementAsString(PatternElement patternElement)
getElementAsString
public static String getElementAsString(Element element)
- Gets the string representation of an element.
- Parameters:
element
- the element to be planified to a string
- Returns:
- the element as a string
getTagReferenceAsString
public static String getTagReferenceAsString(Reference tagRef)
getTagMaskAsString
public static String getTagMaskAsString(TagMask tagMask)
getBoundariesAsString
public static String getBoundariesAsString(Rule rule)
getSuggestionsAsString
public static String getSuggestionsAsString(Rule rule)
createTagMaskFromReference
public static TagMask createTagMaskFromReference(Reference ref,
MorphologicalTag mTag,
ChunkTag cTag,
SyntacticTag sTag)
createTagMaskFromReference
public static TagMask createTagMaskFromReference(Reference ref,
Sentence sent,
int refPos)
createTagMaskFromReferenceSyntatic
public static TagMask createTagMaskFromReferenceSyntatic(Reference ref,
Sentence sent,
int refPos)
completeMissingParts
public static void completeMissingParts(TagMask tagMask,
MorphologicalTag tag)
translate
public static String translate(String ori)
useCasedString
public static String useCasedString(String replaceable,
String replacement)
- Checks the case of the first char from
replaceable
and changes the first char from the
replacement
accordingly.
- Parameters:
replaceable
- the string that will be replacedreplacement
- the string that will be used to replace the replaceable
- Returns:
- the replacement, beginning with upper case if the
replaceable
begins too or
lower case, if not
Copyright © 2012-2013 CoGrOO. All Rights Reserved.