public class AnnotatedTextBuilder extends Object
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()
| Constructor and Description |
|---|
AnnotatedTextBuilder() |
| Modifier and Type | Method and Description |
|---|---|
AnnotatedTextBuilder |
addMarkup(String markup)
Add a markup text snippet like
<b attr='something'> or <div>. |
AnnotatedTextBuilder |
addText(String text)
Add a plain text snippet, to be checked by LanguageTool when using
JLanguageTool.check(AnnotatedText). |
AnnotatedText |
build()
Create the annotated text to be passed into
JLanguageTool.check(AnnotatedText). |
public AnnotatedTextBuilder addText(String text)
JLanguageTool.check(AnnotatedText).public AnnotatedTextBuilder addMarkup(String markup)
<b attr='something'> or <div>. These
parts will be ignored by LanguageTool when using JLanguageTool.check(AnnotatedText).public AnnotatedText build()
JLanguageTool.check(AnnotatedText).