Package org.omegat.languagetools
Class BaseLanguageToolBridge
java.lang.Object
org.omegat.languagetools.BaseLanguageToolBridge
- All Implemented Interfaces:
ILanguageToolBridge
- Direct Known Subclasses:
LanguageToolNativeBridge,LanguageToolNetworkBridge
A base bridge implementation that handles errors thrown by subclasses.
If the subclass throws an exception, the bridge will log the exception and then simply return empty results from then on. This is OK because the bridge is recreated on project load, so in the case of temporary issues the user can just reload the project to restore functionality.
This failsafe is required because LanguageTool checks are called automatically and in large batches, so if an exception is thrown it will likely be thrown repeatedly for all invocations. Especially in the case of the network bridge we would otherwise spam the remote server or even DDoS it.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal List<LanguageToolResult>getCheckResults(String sourceText, String translationText) Get marks for EntryMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.omegat.languagetools.ILanguageToolBridge
applyRuleFilters, stop
-
Constructor Details
-
BaseLanguageToolBridge
public BaseLanguageToolBridge()
-
-
Method Details
-
getCheckResults
Description copied from interface:ILanguageToolBridgeGet marks for Entry- Specified by:
getCheckResultsin interfaceILanguageToolBridge- Returns:
- List of results
-