Package org.omegat.languagetools
Class BaseLanguageToolBridge
- java.lang.Object
-
- org.omegat.languagetools.BaseLanguageToolBridge
-
- All Implemented Interfaces:
ILanguageToolBridge
- Direct Known Subclasses:
LanguageToolNativeBridge
,LanguageToolNetworkBridge
public abstract class BaseLanguageToolBridge extends java.lang.Object implements ILanguageToolBridge
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 Constructor Description BaseLanguageToolBridge()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<LanguageToolResult>
getCheckResults(java.lang.String sourceText, java.lang.String translationText)
Get marks for Entry-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.omegat.languagetools.ILanguageToolBridge
applyRuleFilters, stop
-
-
-
-
Method Detail
-
getCheckResults
public final java.util.List<LanguageToolResult> getCheckResults(java.lang.String sourceText, java.lang.String translationText)
Description copied from interface:ILanguageToolBridge
Get marks for Entry- Specified by:
getCheckResults
in interfaceILanguageToolBridge
- Returns:
- List of results
-
-