Class AnnotatedTextBuilder


  • public class AnnotatedTextBuilder
    extends java.lang.Object
    Use this builder to create input of text with markup for LanguageTool, so that it can check only the plain text parts and ignore the markup, yet still calculate the positions of errors so that they refer to the complete text, including markup.

    It's up to you to split the input into parts that are plain text and parts that are markup.

    For example, text with XML markup like

       Here is <b>some text</b>
     

    needs to be prepared like this:

     new AnnotatedTextBuilder()
       .addText("Here is ").addMarkup("<b>").addText("some text").addMarkup("</b>")
       .build()
     
    Since:
    2.3
    • Field Detail

      • parts

        private final java.util.List<TextPart> parts
      • customMetaData

        private final java.util.Map<java.lang.String,​java.lang.String> customMetaData
    • Constructor Detail

      • AnnotatedTextBuilder

        public AnnotatedTextBuilder()