Class SuggestionReplacer

java.lang.Object
org.languagetool.dev.wikipedia.SuggestionReplacer

public class SuggestionReplacer extends Object
Applies the rule suggestions to a text, considering a mapping so the suggestion can be applied to the original markup of a text.
  • Constructor Details

    • SuggestionReplacer

      public SuggestionReplacer(PlainTextMapping textMapping, String originalText)
      Parameters:
      originalText - the original text that includes markup
    • SuggestionReplacer

      public SuggestionReplacer(PlainTextMapping textMapping, String originalText, ErrorMarker errorMarker)
      Since:
      2.6
  • Method Details

    • applySuggestionsToOriginalText

      public List<RuleMatchApplication> applySuggestionsToOriginalText(RuleMatch match)
      Applies the suggestions from the rule to the original text. For rules that have no suggestion, a pseudo-correction is generated that contains the same text as before.