Class SuggestionsChanges
- java.lang.Object
-
- org.languagetool.rules.spelling.suggestions.SuggestionsChanges
-
public class SuggestionsChanges extends Object
Helper class for SuggestionChangesTest, tracks experiment configuration and results Rules should use getInstance() != null -> getInstance().getCurrentExperiment() in constructors to fetch relevant parameters Use isRunningExperiment if no parameters are needed
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.languagetool.rules.spelling.suggestions.SuggestionChangesTestConfig
getConfig()
@Nullable SuggestionChangesExperiment
getCurrentExperiment()
List<SuggestionChangesExperiment>
getExperiments()
static @Nullable SuggestionsChanges
getInstance()
null if nothing is configured, i.e.static boolean
isRunningExperiment(String name)
void
setCurrentExperiment(@Nullable SuggestionChangesExperiment experiment)
For testing changes to suggestion ordering using a data corpus; iterate over experiments (including grid search for parameters) original behavior (for A/B testing) can be modeled by an experiment without parameters and an arbitrary namevoid
trackExperimentResult(org.apache.commons.lang3.tuple.Pair<SuggestionChangesExperiment,org.languagetool.rules.spelling.suggestions.SuggestionChangesDataset> source, int position, int resultTextSize, long resultComputationTime)
-
-
-
Method Detail
-
getInstance
@Nullable public static @Nullable SuggestionsChanges getInstance()
null if nothing is configured, i.e. in most normal use cases
-
getConfig
public org.languagetool.rules.spelling.suggestions.SuggestionChangesTestConfig getConfig()
-
getCurrentExperiment
@Nullable public @Nullable SuggestionChangesExperiment getCurrentExperiment()
-
setCurrentExperiment
public void setCurrentExperiment(@Nullable @Nullable SuggestionChangesExperiment experiment)
For testing changes to suggestion ordering using a data corpus; iterate over experiments (including grid search for parameters) original behavior (for A/B testing) can be modeled by an experiment without parameters and an arbitrary name
-
isRunningExperiment
public static boolean isRunningExperiment(String name)
-
trackExperimentResult
public void trackExperimentResult(org.apache.commons.lang3.tuple.Pair<SuggestionChangesExperiment,org.languagetool.rules.spelling.suggestions.SuggestionChangesDataset> source, int position, int resultTextSize, long resultComputationTime)
-
getExperiments
public List<SuggestionChangesExperiment> getExperiments()
-
-