@@ -32,6 +32,9 @@ public class TranslateText {
32
32
33
33
/**
34
34
* Detect the language of input text.
35
+ *
36
+ * @param sourceText source text to be detected for language
37
+ * @param out print stream
35
38
*/
36
39
public static void detectLanguage (String sourceText , PrintStream out ) {
37
40
List <Detection > detections = TRANSLATE .detect (ImmutableList .of (sourceText ));
@@ -43,6 +46,9 @@ public static void detectLanguage(String sourceText, PrintStream out) {
43
46
44
47
/**
45
48
* Translates the source text in any language to english.
49
+ *
50
+ * @param sourceText source text to be translated
51
+ * @param out print stream
46
52
*/
47
53
public static void translateText (String sourceText , PrintStream out ) {
48
54
Translation translation = TRANSLATE .translate (sourceText );
@@ -52,6 +58,11 @@ public static void translateText(String sourceText, PrintStream out) {
52
58
53
59
/**
54
60
* Translate the source text from source to target language.
61
+ *
62
+ * @param sourceText source text to be translated
63
+ * @param sourceLang source language of the text
64
+ * @param targetLang target language of translated text
65
+ * @param out print stream
55
66
*/
56
67
public static void translateTextWithOptions (
57
68
String sourceText ,
@@ -68,7 +79,9 @@ public static void translateTextWithOptions(
68
79
}
69
80
70
81
/**
71
- * Displays a list of supported languages (codes).
82
+ * Displays a list of supported languages and codes.
83
+ *
84
+ * @param out print stream
72
85
*/
73
86
public static void displaySupportedLanguages (PrintStream out ) {
74
87
List <Language > languages = TRANSLATE .listSupportedLanguages ();
0 commit comments