Package org.languagetool.server
Class ResultExtender
java.lang.Object
org.languagetool.server.ResultExtender
Extend results by adding rules matches from a different API server.
- Since:
- 4.0
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
private static final org.slf4j.Logger
private final com.fasterxml.jackson.databind.ObjectMapper
private final URL
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate String
(package private) @NotNull List
<RemoteRuleMatch> getExtensionMatches
(String plainText, Map<String, String> params) (package private) @NotNull List
<org.languagetool.rules.RuleMatch> getFilteredExtensionMatches
(List<org.languagetool.rules.RuleMatch> matches, List<RemoteRuleMatch> extensionMatches) FilterextensionMatches
so that only those matches are left that don't cover or touch one of thematches
.private @NotNull RemoteRuleMatch
private String
private Object
getRequired
(Map<String, Object> elem, String propertyName) private String
getRequiredString
(Map<String, Object> elem, String propertyName) getValueList
(Map<String, Object> match, String propertyName) private @NotNull List
<RemoteRuleMatch> parseJson
(InputStream inputStream)
-
Field Details
-
logger
private static final org.slf4j.Logger logger -
url
-
connectTimeoutMillis
private final int connectTimeoutMillis -
mapper
private final com.fasterxml.jackson.databind.ObjectMapper mapper
-
-
Constructor Details
-
ResultExtender
ResultExtender(String url, int connectTimeoutMillis)
-
-
Method Details
-
getFilteredExtensionMatches
@NotNull @NotNull List<org.languagetool.rules.RuleMatch> getFilteredExtensionMatches(List<org.languagetool.rules.RuleMatch> matches, List<RemoteRuleMatch> extensionMatches) FilterextensionMatches
so that only those matches are left that don't cover or touch one of thematches
. -
getExtensionMatches
@NotNull @NotNull List<RemoteRuleMatch> getExtensionMatches(String plainText, Map<String, String> params) throws IOException- Throws:
IOException
-
encode
- Throws:
UnsupportedEncodingException
-
parseJson
@NotNull private @NotNull List<RemoteRuleMatch> parseJson(InputStream inputStream) throws IOException - Throws:
IOException
-
getMatch
-
getRequired
-
getRequiredString
-
getOrNull
-
getValueList
-