public static class MarianTranslator.MarianServerClient extends Object
Constructor and Description |
---|
MarianServerClient(URI endpointURI,
File file)
Marian Server Web Socket Client.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the connection to the Marian Server.
|
void |
onClose(jakarta.websocket.Session session) |
void |
onOpen(jakarta.websocket.Session session) |
void |
processMessage(String message) |
void |
translate(String sourceText)
Translate the passed text using the Marian Server.
|
public MarianServerClient(URI endpointURI, File file) throws TikaException
endpointURI
- the endpoint URI for the Marian Server instance.file
- the location of the file to write the translation response to.TikaException
public void onOpen(jakarta.websocket.Session session)
public void processMessage(String message) throws IOException
IOException
public void onClose(jakarta.websocket.Session session)
public void translate(String sourceText) throws IOException
sourceText
- the source text to translate.IOException
- on any I/O error calling the server.public void close() throws IOException
IOException
- on any I/O error calling the server.Copyright © 2007–2023 The Apache Software Foundation. All rights reserved.