Package org.languagetool.remote
Class ArtificialErrorEval
java.lang.Object
org.languagetool.remote.ArtificialErrorEval
Takes correct sentences, introduces errors (e.g. confusion pairs), and
evaluates the LT rules.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static int[](package private) static String(package private) static HashMap<String, List<RemoteRuleMatch>> (package private) static int(package private) static int(package private) static int(package private) static String(package private) static int(package private) static String(package private) static String[](package private) static boolean(package private) static boolean(package private) static boolean(package private) static boolean(package private) static String(package private) static Language(package private) static String[](package private) static JLanguageTool(package private) static RemoteLanguageTool(package private) static int(package private) static int(package private) static String(package private) static Pattern(package private) static String(package private) static int[][](package private) static String(package private) static Synthesizer(package private) static boolean(package private) static String(package private) static boolean(package private) static String(package private) static boolean(package private) static String[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidanalyzeSentence(String correctSentence, int j, int fromPos, CheckConfiguration config) private static voidappendToFile(String FilePath, String text) private static StringformattedAbsoluteAndPercentage(String tag, int i, int j) private static booleanisEmptySuggestionAtPos(List<RemoteRuleMatch> matchesCorrect, int pos, String expectedSuggestion, String wrongSentence, String correctSentence) private static booleanisExpectedSuggestionAtPos(List<RemoteRuleMatch> matchesCorrect, int pos, String expectedSuggestion, String wrongSentence, String correctSentence) static voidprivate static Stringprivate static voidprintSentenceOutput(String classification, String sentence, int i, String ruleIds) private static StringprintTimeFromStart(long start, String tag) ruleIDsAtPos(List<RemoteRuleMatch> matchesCorrect, int pos, String expectedSuggestion) private static voidrun(boolean printSummaryDetails) private static voidrunEvaluationOnFile(String languageCode, String inputFile, String outputFolder) private static voidrunEvaluationOnFolders(String inputFolder, String outputFolder, boolean printSummaryDetails, boolean printHeader) static voidwait(int ms) private static void
-
Field Details
-
words
-
lemmas
-
fakeRuleIDs
-
classifyTypes
-
results
static int[][] results -
accumulateResults
static int[] accumulateResults -
lt
-
localLt
-
synth
-
maxInputSentences
static int maxInputSentences -
verboseOutput
static boolean verboseOutput -
unidirectional
static boolean unidirectional -
wholeword
static boolean wholeword -
isDoubleLetters
static boolean isDoubleLetters -
isDiacritics
static boolean isDiacritics -
inflected
static boolean inflected -
isParallelCorpus
static boolean isParallelCorpus -
columnCorrect
static int columnCorrect -
columnIncorrect
static int columnIncorrect -
pWordboundaries
-
countLine
static int countLine -
checkedSentences
static int checkedSentences -
maxCheckedSentences
static int maxCheckedSentences -
onlyRules
-
disabledRules
-
enabledOnlyRules
-
summaryOutputFilename
-
verboseOutputFilename
-
errorCategory
-
langCode
-
language
-
corpusFilePath
-
outputPathRoot
-
cachedMatches
-
remoteServer
-
userName
-
apiKey
-
-
Constructor Details
-
ArtificialErrorEval
public ArtificialErrorEval()
-
-
Method Details
-
main
- Throws:
IOException
-
runEvaluationOnFile
private static void runEvaluationOnFile(String languageCode, String inputFile, String outputFolder) throws IOException - Throws:
IOException
-
runEvaluationOnFolders
private static void runEvaluationOnFolders(String inputFolder, String outputFolder, boolean printSummaryDetails, boolean printHeader) throws IOException - Throws:
IOException
-
run
- Throws:
IOException
-
formattedAbsoluteAndPercentage
-
printTimeFromStart
-
appendToFile
- Throws:
IOException
-
analyzeSentence
private static void analyzeSentence(String correctSentence, int j, int fromPos, CheckConfiguration config) throws IOException - Throws:
IOException
-
printSentenceOutput
private static void printSentenceOutput(String classification, String sentence, int i, String ruleIds) throws IOException - Throws:
IOException
-
ruleIDsAtPos
private static List<String> ruleIDsAtPos(List<RemoteRuleMatch> matchesCorrect, int pos, String expectedSuggestion) -
isExpectedSuggestionAtPos
private static boolean isExpectedSuggestionAtPos(List<RemoteRuleMatch> matchesCorrect, int pos, String expectedSuggestion, String wrongSentence, String correctSentence) -
isEmptySuggestionAtPos
private static boolean isEmptySuggestionAtPos(List<RemoteRuleMatch> matchesCorrect, int pos, String expectedSuggestion, String wrongSentence, String correctSentence) -
writeHelp
private static void writeHelp() -
wait
public static void wait(int ms) -
printCurrentDateTime
-