Class CorrectionRuleBuilder
- java.lang.Object
-
- org.predict4all.nlp.words.correction.model.CorrectionRuleBuilder
-
public class CorrectionRuleBuilder extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addTo(java.util.Collection<CorrectionRuleBuilder> rulesCollection)
void
buildAndAddTo(PredictionParameter predictionParameter, java.util.Map<CorrectionRule,CorrectionRule> rulesCollection)
void
buildAndAddTo(PredictionParameter predictionParameter, java.util.Map<CorrectionRule,CorrectionRule> rulesCollection, java.util.function.BiConsumer<CorrectionRule,CorrectionRule> duplicatedRuleConsumer)
java.util.Map<CorrectionRule,CorrectionRule>
buildList(PredictionParameter predictionParameter)
java.lang.Double
getCost()
java.lang.String[]
getErrors()
java.lang.Double
getFactor()
java.lang.Integer
getMaxIndexFromEnd()
java.lang.Integer
getMaxIndexFromStart()
java.lang.Integer
getMinIndexFromEnd()
java.lang.Integer
getMinIndexFromStart()
java.lang.String[]
getReplacements()
boolean
isBidirectionnal()
static CorrectionRuleBuilder
readFrom(java.lang.String line)
static CorrectionRuleBuilder
ruleBuilder()
java.lang.String
toString()
CorrectionRuleBuilder
withBidirectionnal(boolean bidirectionnal)
CorrectionRuleBuilder
withConfusionSet(java.lang.String... elements)
CorrectionRuleBuilder
withCost(double cost)
CorrectionRuleBuilder
withError(java.lang.String... errors)
CorrectionRuleBuilder
withFactor(double factor)
CorrectionRuleBuilder
withMaxIndexFromEnd(int maxIndexFromEnd)
CorrectionRuleBuilder
withMaxIndexFromStart(int maxIndexFromStart)
CorrectionRuleBuilder
withMinIndexFromEnd(int minIndexFromEnd)
CorrectionRuleBuilder
withMinIndexFromStart(int minIndexFromStart)
CorrectionRuleBuilder
withReplacement(java.lang.String... replacements)
java.lang.String
write()
-
-
-
Method Detail
-
ruleBuilder
public static CorrectionRuleBuilder ruleBuilder()
-
withError
public CorrectionRuleBuilder withError(java.lang.String... errors)
-
withReplacement
public CorrectionRuleBuilder withReplacement(java.lang.String... replacements)
-
withFactor
public CorrectionRuleBuilder withFactor(double factor)
-
withMaxIndexFromStart
public CorrectionRuleBuilder withMaxIndexFromStart(int maxIndexFromStart)
-
withMaxIndexFromEnd
public CorrectionRuleBuilder withMaxIndexFromEnd(int maxIndexFromEnd)
-
withMinIndexFromStart
public CorrectionRuleBuilder withMinIndexFromStart(int minIndexFromStart)
-
withMinIndexFromEnd
public CorrectionRuleBuilder withMinIndexFromEnd(int minIndexFromEnd)
-
withCost
public CorrectionRuleBuilder withCost(double cost)
-
withBidirectionnal
public CorrectionRuleBuilder withBidirectionnal(boolean bidirectionnal)
-
withConfusionSet
public CorrectionRuleBuilder withConfusionSet(java.lang.String... elements)
-
addTo
public void addTo(java.util.Collection<CorrectionRuleBuilder> rulesCollection)
-
getErrors
public java.lang.String[] getErrors()
-
getReplacements
public java.lang.String[] getReplacements()
-
getFactor
public java.lang.Double getFactor()
-
getMaxIndexFromStart
public java.lang.Integer getMaxIndexFromStart()
-
getMaxIndexFromEnd
public java.lang.Integer getMaxIndexFromEnd()
-
getMinIndexFromStart
public java.lang.Integer getMinIndexFromStart()
-
getMinIndexFromEnd
public java.lang.Integer getMinIndexFromEnd()
-
getCost
public java.lang.Double getCost()
-
isBidirectionnal
public boolean isBidirectionnal()
-
buildAndAddTo
public void buildAndAddTo(PredictionParameter predictionParameter, java.util.Map<CorrectionRule,CorrectionRule> rulesCollection)
-
buildAndAddTo
public void buildAndAddTo(PredictionParameter predictionParameter, java.util.Map<CorrectionRule,CorrectionRule> rulesCollection, java.util.function.BiConsumer<CorrectionRule,CorrectionRule> duplicatedRuleConsumer)
-
buildList
public java.util.Map<CorrectionRule,CorrectionRule> buildList(PredictionParameter predictionParameter)
-
readFrom
public static CorrectionRuleBuilder readFrom(java.lang.String line)
-
write
public java.lang.String write()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-