Package org.languagetool.markup
Class AnnotatedText
java.lang.Object
org.languagetool.markup.AnnotatedText
A text with markup and with a mapping so error positions will refer to the original
position that includes the markup, even though only the plain text parts are checked.
Use
AnnotatedTextBuilder
to create objects of this type.- Since:
- 2.3
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map
<Integer, MappingValue> private final Map
<AnnotatedText.MetaDataKey, String> -
Constructor Summary
ConstructorsConstructorDescriptionAnnotatedText
(List<TextPart> parts, Map<Integer, MappingValue> mapping, Map<AnnotatedText.MetaDataKey, String> metaData, Map<String, String> customMetaData) -
Method Summary
Modifier and TypeMethodDescriptiongetGlobalMetaData
(String key, String defaultValue) getGlobalMetaData
(AnnotatedText.MetaDataKey key, String defaultValue) Get the plain text, without markup and content frominterpretAs
.int
getOriginalTextPositionFor
(int plainTextPosition, boolean isToPos) Internally used by LanguageTool to adjust error positions to point to the original location with markup, even though markup was ignored during text checking.Get the plain text, without markup but with content frominterpretAs
.toString()
-
Field Details
-
parts
-
mapping
-
metaData
-
customMetaData
-
-
Constructor Details
-
AnnotatedText
-
-
Method Details
-
getOriginalText
Get the plain text, without markup and content frominterpretAs
.- Since:
- 4.3
-
getPlainText
Get the plain text, without markup but with content frominterpretAs
. -
getTextWithMarkup
- Since:
- 4.3
-
getOriginalTextPositionFor
public int getOriginalTextPositionFor(int plainTextPosition, boolean isToPos) Internally used by LanguageTool to adjust error positions to point to the original location with markup, even though markup was ignored during text checking.- Parameters:
plainTextPosition
- the position in the plain text (no markup) that was checkedisToPos
- the from/to position needed- Returns:
- an adjusted position of the same location in the text with markup
-
getGlobalMetaData
- Since:
- 3.9
-
getGlobalMetaData
- Since:
- 3.9
-
toString
-