Skip to content

Commit e3a5cc0

Browse files
Merge pull request #405 from watson-developer-cloud/language_translator
Language translator
2 parents a47c18b + e327f09 commit e3a5cc0

34 files changed

+112
-1679
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ APIs and SDKs that use cognitive computing to solve complex problems.
2626
* [Conversation](#conversation)
2727
* [Dialog](#dialog)
2828
* [Document Conversion](#document-conversion)
29-
* [Language Translator](#language-translator)
29+
* [Language Translation](#language-translation)
3030
* [Natural Language Classifier](#natural-language-classifier)
3131
* [Personality Insights](#personality-insights)
3232
* [Relationship Extraction](#relationship-extraction)
@@ -302,12 +302,12 @@ Answers htmlToAnswers = service.convertDocumentToAnswer(doc).execute();
302302
System.out.println(htmlToAnswers);
303303
```
304304

305-
### Language Translator
305+
### Language Translation
306306
Select a domain, then identify or select the language of text, and then translate the text from one supported language to another.
307-
Example: Translate 'hello' from English to Spanish using the [Language Translator][language_translator] service.
307+
Example: Translate 'hello' from English to Spanish using the [Language Translator][language_translation] service.
308308

309309
```java
310-
LanguageTranslator service = new LanguageTranslator();
310+
LanguageTranslator service = new LanguageTranslation();
311311
service.setUsernameAndPassword("<username>", "<password>");
312312

313313
TranslationResult translationResult = service.translate(
@@ -619,7 +619,7 @@ See [CONTRIBUTING.md](.github/CONTRIBUTING.md).
619619
[personality_insights]: http://www.ibm.com/watson/developercloud/doc/personality-insights/
620620
[document_conversion]: http://www.ibm.com/watson/developercloud/doc/document-conversion/
621621
[relationship_extraction]: http://www.ibm.com/watson/developercloud/doc/sireapi/
622-
[language_translator]: http://www.ibm.com/watson/developercloud/doc/language-translation/
622+
[language_translation]: http://www.ibm.com/watson/developercloud/doc/language-translation/
623623
[visual_recognition]: http://www.ibm.com/watson/developercloud/doc/visual-recognition/
624624
[tradeoff_analytics]: http://www.ibm.com/watson/developercloud/doc/tradeoff-analytics/
625625
[text_to_speech]: http://www.ibm.com/watson/developercloud/doc/text-to-speech/

examples/java/com/ibm/watson/developer_cloud/speech_to_text/v1/MicrophoneWithWebSocketsExample.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,10 @@
1313
*/
1414
package com.ibm.watson.developer_cloud.speech_to_text.v1;
1515

16-
import java.io.FileNotFoundException;
17-
1816
import javax.sound.sampled.AudioFormat;
1917
import javax.sound.sampled.AudioInputStream;
2018
import javax.sound.sampled.AudioSystem;
2119
import javax.sound.sampled.DataLine;
22-
import javax.sound.sampled.LineUnavailableException;
2320
import javax.sound.sampled.TargetDataLine;
2421

2522
import com.ibm.watson.developer_cloud.http.HttpMediaType;

src/main/java/com/ibm/watson/developer_cloud/conversation/v1_experimental/model/MessageResponse.java

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
* The response payload from the Conversation service's message API call
2525
* {@link ConversationService#message(String, MessageRequest)}.
2626
*
27-
* @see <a href="http://www.ibm.com/watson/developercloud/conversation.html">
28-
* http://www.ibm.com/watson/developercloud/conversation.html</a>
27+
* @see <a href="http://www.ibm.com/watson/developercloud/conversation.html"> http://www.ibm.com/
28+
* watson/developercloud/conversation.html</a>
2929
*/
3030
public class MessageResponse extends GenericModel {
3131
private static final String TEXT = "text";
@@ -243,6 +243,7 @@ public void setOutput(Map<String, Object> output) {
243243
*
244244
* @return an array of strings which is to be displayed/returned to the end user
245245
*/
246+
@SuppressWarnings("unchecked")
246247
public List<String> getText() {
247248
if (output != null && output.containsKey(TEXT)) {
248249
List<?> text = (List<?>) output.get(TEXT);
@@ -257,7 +258,8 @@ public List<String> getText() {
257258
* A convenience method for getting the text property from the output object. The text property is
258259
* an array of strings. This convenience class concatenates the array, separating each entry with
259260
* the separator string.
260-
*
261+
*
262+
* @param separator the separator
261263
* @return a concatenation of the strings in the output array, with each string separated by the
262264
* separator string
263265
*/
@@ -269,14 +271,29 @@ public String getTextConcatenated(String separator) {
269271
return null;
270272
}
271273

274+
/**
275+
* Gets the input.
276+
*
277+
* @return the input
278+
*/
272279
public Map<String, Object> getInput() {
273280
return input;
274281
}
275282

283+
/**
284+
* Sets the input.
285+
*
286+
* @param input the input
287+
*/
276288
public void setInput(Map<String, Object> input) {
277289
this.input = input;
278290
}
279291

292+
/**
293+
* Gets the input text.
294+
*
295+
* @return the input text
296+
*/
280297
public String getInputText() {
281298
if (this.input != null && this.input.containsKey(TEXT)) {
282299
return this.input.get(TEXT).toString();

src/main/java/com/ibm/watson/developer_cloud/language_translation/v2/LanguageTranslation.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,11 @@
4444
* The IBM Watson Language Translator service translate text from one language to another and
4545
* identifies the language in which text is written.
4646
*
47-
* <p>This class is deprecated. Use {@link com.ibm.watson.developer_cloud.language_translator.v2.LanguageTranslator}
48-
* instead.</p>
49-
*
5047
* @version v2
5148
* @see <a href=
5249
* "http://www.ibm.com/watson/developercloud/language-translation.html">
53-
* Language Translator</a>
50+
* Language translation</a>
5451
*/
55-
@Deprecated
5652
public class LanguageTranslation extends WatsonService {
5753

5854
private static final String LANGUAGES = "languages";

src/main/java/com/ibm/watson/developer_cloud/language_translation/v2/model/CreateModelOptions.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,13 @@
1515
package com.ibm.watson.developer_cloud.language_translation.v2.model;
1616

1717
import java.io.File;
18+
1819
import com.ibm.watson.developer_cloud.language_translation.v2.LanguageTranslation;
1920

2021
/**
2122
* Model Options when using the {@link LanguageTranslation#createModel(CreateModelOptions)} method.
2223
*
23-
* <p>This class is deprecated. Use the {@code language_translator} classes instead.</p>
2424
*/
25-
@Deprecated
2625
public class CreateModelOptions {
2726

2827
/**

src/main/java/com/ibm/watson/developer_cloud/language_translation/v2/model/IdentifiableLanguage.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,8 @@
1919
/**
2020
* Identifiable language used by the {@link LanguageTranslation} service.
2121
*
22-
* <p>This class is deprecated. Use the {@code language_translator} classes instead.</p>
2322
*
2423
*/
25-
@Deprecated
2624
public class IdentifiableLanguage extends GenericModel {
2725

2826
private final String language;

src/main/java/com/ibm/watson/developer_cloud/language_translation/v2/model/IdentifiedLanguage.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@
1818
/**
1919
* Language detected by the {@link LanguageTranslation} service.
2020
*
21-
* <p>This class is deprecated. Use the {@code language_translator} classes instead.</p>
22-
*
2321
*/
24-
@Deprecated
2522
public class IdentifiedLanguage extends IdentifiableLanguage {
2623

2724
/** The confidence. */

src/main/java/com/ibm/watson/developer_cloud/language_translation/v2/model/Language.java

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,21 @@
1717

1818
/**
1919
* The languages available in {@link LanguageTranslation}.
20-
*
21-
* <p>This class is deprecated. Use the {@code language_translator} classes instead.</p>
2220
*/
23-
@Deprecated
2421
public enum Language {
25-
2622
/** arabic. */
2723
ARABIC("ar"),
28-
/** english. */
29-
ENGLISH("en"),
30-
/** spanish. */
31-
SPANISH("es"),
32-
/** french. */
33-
FRENCH("fr"),
34-
/** italian. */
35-
ITALIAN("it"),
36-
/** portuguese. */
37-
PORTUGUESE("pt");
38-
24+
/** english. */
25+
ENGLISH("en"),
26+
/** spanish. */
27+
SPANISH("es"),
28+
/** french. */
29+
FRENCH("fr"),
30+
/** italian. */
31+
ITALIAN("it"),
32+
/** portuguese. */
33+
PORTUGUESE("pt");
34+
3935
/** language. */
4036
String language;
4137

src/main/java/com/ibm/watson/developer_cloud/language_translation/v2/model/Translation.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@
2020
/**
2121
* The Translation result used as POJO by the {@link LanguageTranslation}.
2222
*
23-
* <p>This class is deprecated. Use the {@code language_translator} classes instead.</p>
24-
*
2523
*/
26-
@Deprecated
2724
public class Translation extends GenericModel {
2825

2926
/** The translation. */

src/main/java/com/ibm/watson/developer_cloud/language_translation/v2/model/TranslationModel.java

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,17 @@
1919
/**
2020
* Language Model used by the {@link TranslationModel}.
2121
*
22-
* <p>This class is deprecated. Use the {@code language_translator} classes instead.</p>
2322
*/
24-
@Deprecated
2523
public class TranslationModel extends GenericModel {
26-
24+
2725
/**
2826
* The Enum Status.
2927
*/
3028
public enum Status {
31-
3229
/** The available. */
33-
AVAILABLE,
34-
/** The error. */
35-
ERROR,
36-
/** The training. */
37-
TRAINING;
30+
AVAILABLE, /** The error. */
31+
ERROR, /** The training. */
32+
TRAINING;
3833
}
3934

4035
@SerializedName("base_model_id")

0 commit comments

Comments
 (0)