public class SuggestedReplacement extends Object
Modifier and Type | Class and Description |
---|---|
static class |
SuggestedReplacement.SuggestionType
classify the type of the suggestion
so that downstream tasks (e.g. resorting, as in
BERTSuggestionRanking )
can treat them accordingly
Default - default, no special treatment
Translation - offers to translate words from native language into text language;
suggestion ranking extends size of list of candidates
Curated - a manually curated suggestion / special case / ...; don't resort |
Constructor and Description |
---|
SuggestedReplacement(String replacement) |
SuggestedReplacement(String replacement,
String shortDescription) |
SuggestedReplacement(String replacement,
String shortDescription,
String suffix) |
SuggestedReplacement(SuggestedReplacement repl) |
Modifier and Type | Method and Description |
---|---|
static List<SuggestedReplacement> |
convert(List<String> suggestions) |
boolean |
equals(Object o) |
Float |
getConfidence() |
SortedMap<String,Float> |
getFeatures() |
String |
getReplacement() |
String |
getShortDescription() |
String |
getSuffix()
Value shown in the UI after the replacement (but not part of it).
|
SuggestedReplacement.SuggestionType |
getType() |
int |
hashCode() |
void |
setConfidence(Float confidence) |
void |
setFeatures(SortedMap<String,Float> features) |
void |
setReplacement(String replacement) |
void |
setShortDescription(String desc) |
void |
setSuffix(String val) |
void |
setType(SuggestedReplacement.SuggestionType type) |
static List<SuggestedReplacement> |
topMatch(String word) |
static List<SuggestedReplacement> |
topMatch(String word,
String shortDesc) |
String |
toString() |
public SuggestedReplacement(String replacement)
public SuggestedReplacement(String replacement, String shortDescription, String suffix)
public SuggestedReplacement(SuggestedReplacement repl)
public String getReplacement()
public void setReplacement(String replacement)
@Nullable public String getShortDescription()
public void setShortDescription(String desc)
public void setType(SuggestedReplacement.SuggestionType type)
@NotNull public SuggestedReplacement.SuggestionType getType()
@Nullable public String getSuffix()
public void setSuffix(String val)
@Nullable public Float getConfidence()
public void setConfidence(@Nullable Float confidence)
public static List<SuggestedReplacement> convert(List<String> suggestions)
public static List<SuggestedReplacement> topMatch(String word)
public static List<SuggestedReplacement> topMatch(String word, String shortDesc)