slotMaximumTokenCountMap.put(slotName, histogram.size() - 1); // -1 since the
// zero-histogram point
// also needs a place!
TextRulerRuleList ctxRules = new TextRulerRuleList();
TextRulerRuleList bestRules = learnTaggingRules(new TextRulerTarget(slotName,
MLTargetType.SINGLE_LEFT_BOUNDARY, this), ctxRules); // learn
// left
// boundary
// best
// rules
if (bestRules != null) {
leftBoundaryBestRulesMap.put(slotName, bestRules.getRulesString(""));
leftBoundaryContextualRulesMap.put(slotName, ctxRules.getRulesString("\t"));
bestRules.clear(); // free som memory/references
}
if (shouldAbort())
return;
ctxRules.clear();
bestRules = learnTaggingRules(new TextRulerTarget(slotName, MLTargetType.SINGLE_RIGHT_BOUNDARY,
this), ctxRules); // learn
// right
// boundary best
// rules
if (bestRules != null) {
rightBoundaryBestRulesMap.put(slotName, bestRules.getRulesString(""));
rightBoundaryContextualRulesMap.put(slotName, ctxRules.getRulesString("\t"));
}
// TODO add correction rule learn stuff
// testTaggingRulesAndCreateCorrectionRulesExamples(null, STANDARD_MAX_CONTEXTUAL_RULES_COUNT)
// correct left start
TextRulerTarget lsTarget = new TextRulerTarget(slotName, MLTargetType.SINGLE_LEFT_CORRECTION,
this);
lsTarget.setMaxShiftDistance(shiftSize);
TextRulerRuleList correctLeftRules = learnTaggingRules(lsTarget, null);
// resultString = "CAP{REGEXP(\"PM\")} ALL{->MARKONCE(stimeEND)};";
// try {
// FileUtils.saveString2File(resultString, file);