Package org.languagetool.rules
Class ScoredConfusionSet
- java.lang.Object
-
- org.languagetool.rules.ScoredConfusionSet
-
public class ScoredConfusionSet extends java.lang.Object
Words that can easily be confused - for internal use only. Even though there can be more words in the confusionWords, usually there are two, as the factor is specific for this pair of words. A ScoredConfusionSet has a positive score associated with it. TODO remove code duplication with ConfusionSet
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<ConfusionString>
confusionWords
private float
score
-
Constructor Summary
Constructors Constructor Description ScoredConfusionSet(float score, java.util.List<ConfusionString> words)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
java.util.List<java.lang.String>
getConfusionTokens()
float
getScore()
java.util.List<java.util.Optional<java.lang.String>>
getTokenDescriptions()
int
hashCode()
java.lang.String
toString()
-
-
-
Field Detail
-
confusionWords
private java.util.List<ConfusionString> confusionWords
-
score
private final float score
-
-
Constructor Detail
-
ScoredConfusionSet
public ScoredConfusionSet(float score, java.util.List<ConfusionString> words)
- Parameters:
score
- the score that a string must get at least to be considered a correction, must be > 0
-
-
Method Detail
-
getScore
public float getScore()
-
getConfusionTokens
public java.util.List<java.lang.String> getConfusionTokens()
-
getTokenDescriptions
public java.util.List<java.util.Optional<java.lang.String>> getTokenDescriptions()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-