Class SuggestionsChanges
java.lang.Object
org.languagetool.rules.spelling.suggestions.SuggestionsChanges
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
Modifier and TypeMethodDescriptionorg.languagetool.rules.spelling.suggestions.SuggestionChangesTestConfig@Nullable SuggestionChangesExperimentstatic @Nullable SuggestionsChangesnull if nothing is configured, i.e. in most normal use casesstatic booleanisRunningExperiment(String name) voidsetCurrentExperiment(@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 namevoidtrackExperimentResult(org.apache.commons.lang3.tuple.Pair<SuggestionChangesExperiment, org.languagetool.rules.spelling.suggestions.SuggestionChangesDataset> source, int position, int resultTextSize, long resultComputationTime)
-
Method Details
-
getInstance
null if nothing is configured, i.e. in most normal use cases -
getConfig
public org.languagetool.rules.spelling.suggestions.SuggestionChangesTestConfig getConfig() -
getCurrentExperiment
-
setCurrentExperiment
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
-
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
-