Autopsy
4.16.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
|
Inherits org.sleuthkit.autopsy.texttranslation.TextTranslator.
Public Member Functions | |
BingTranslator () | |
int | getMaxTextChars () |
String | getName () |
JPanel | getSettingsPanel () |
String | postTranslationRequest (String string) throws IOException |
void | saveSettings () throws TranslationConfigException |
String | translate (String string) throws TranslationException |
Private Member Functions | |
String | parseJSONResponse (String json_text) throws TranslationException |
Private Attributes | |
final OkHttpClient | CLIENT = new OkHttpClient() |
final BingTranslatorSettings | settings = new BingTranslatorSettings() |
final BingTranslatorSettingsPanel | settingsPanel |
Static Private Attributes | |
static final String | BASE_URL = "https://api.cognitive.microsofttranslator.com/translate?api-version=3.0&to=" |
static final int | MAX_STRING_LENGTH = 5000 |
Translates text by making HTTP requests to Bing Translator. This requires a valid subscription key for a Microsoft Azure account.
Definition at line 42 of file BingTranslator.java.
org.sleuthkit.autopsy.texttranslation.translators.BingTranslator.BingTranslator | ( | ) |
Create a Bing Translator
Definition at line 57 of file BingTranslator.java.
int org.sleuthkit.autopsy.texttranslation.translators.BingTranslator.getMaxTextChars | ( | ) |
Gets the maximum number of characters allowed in a translation request.
Implements org.sleuthkit.autopsy.texttranslation.TextTranslator.
Definition at line 177 of file BingTranslator.java.
String org.sleuthkit.autopsy.texttranslation.translators.BingTranslator.getName | ( | ) |
Get the name of the TextTranslator implementation
Implements org.sleuthkit.autopsy.texttranslation.TextTranslator.
Definition at line 131 of file BingTranslator.java.
JPanel org.sleuthkit.autopsy.texttranslation.translators.BingTranslator.getSettingsPanel | ( | ) |
Get the JPanel to display on the settings options panel when this TextTranslator is selected
Implements org.sleuthkit.autopsy.texttranslation.TextTranslator.
Definition at line 136 of file BingTranslator.java.
|
private |
Parse the response to get the translated text
json_text | the json which was received as a response to a translation request |
TranslationException |
Definition at line 157 of file BingTranslator.java.
String org.sleuthkit.autopsy.texttranslation.translators.BingTranslator.postTranslationRequest | ( | String | string | ) | throws IOException |
Converts an input text to the JSON format required by Bing Translator, posts it to Microsoft, and returns the JSON text response.
string | The input text to be translated. |
IOException | if the request could not be executed due to cancellation, a connectivity problem or timeout. |
Definition at line 85 of file BingTranslator.java.
void org.sleuthkit.autopsy.texttranslation.translators.BingTranslator.saveSettings | ( | ) | throws TranslationConfigException |
Saves the current state of the settings in the settings panel.
TranslationConfigException |
Implements org.sleuthkit.autopsy.texttranslation.TextTranslator.
Definition at line 141 of file BingTranslator.java.
String org.sleuthkit.autopsy.texttranslation.translators.BingTranslator.translate | ( | String | input | ) | throws TranslationException |
Translates a provided string
input | the String to translate |
TranslationException |
Implements org.sleuthkit.autopsy.texttranslation.TextTranslator.
Definition at line 105 of file BingTranslator.java.
|
staticprivate |
Definition at line 47 of file BingTranslator.java.
|
private |
Definition at line 52 of file BingTranslator.java.
|
staticprivate |
Definition at line 48 of file BingTranslator.java.
|
private |
Definition at line 50 of file BingTranslator.java.
|
private |
Definition at line 49 of file BingTranslator.java.
Copyright © 2012-2020 Basis Technology. Generated on: Tue Sep 22 2020
This work is licensed under a
Creative Commons Attribution-Share Alike 3.0 United States License.