Class MarianTranslator.MarianServerClient
java.lang.Object
org.apache.tika.language.translate.impl.MarianTranslator.MarianServerClient
- Enclosing class:
- MarianTranslator
Internal Client for marian-server Web Socket Server.
-
Constructor Summary
ConstructorsConstructorDescriptionMarianServerClient(URI endpointURI, File file) Marian Server Web Socket Client. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the connection to the Marian Server.voidonClose(jakarta.websocket.Session session) voidonOpen(jakarta.websocket.Session session) voidprocessMessage(String message) voidTranslate the passed text using the Marian Server.
-
Constructor Details
-
MarianServerClient
Marian Server Web Socket Client.- Parameters:
endpointURI- the endpoint URI for the Marian Server instance.file- the location of the file to write the translation response to.- Throws:
TikaException
-
-
Method Details
-
onOpen
public void onOpen(jakarta.websocket.Session session) -
processMessage
- Throws:
IOException
-
onClose
public void onClose(jakarta.websocket.Session session) -
translate
Translate the passed text using the Marian Server.- Parameters:
sourceText- the source text to translate.- Throws:
IOException- on any I/O error calling the server.
-
close
Close the connection to the Marian Server.- Throws:
IOException- on any I/O error calling the server.
-