Skip to content

Commit 7786c44

Browse files
committed
refactor(examples): Update Tone Analyzer examples
1 parent 8455dbf commit 7786c44

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

examples/src/main/java/com/ibm/watson/developer_cloud/tone_analyzer/v3/ToneAnalyzerChatExample.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ public class ToneAnalyzerExample {
2323

2424

2525
public static void main(String[] args) {
26-
final String VERSION_DATE = "2016-05-19";
27-
ToneAnalyzer service = new ToneAnalyzer(VERSION_DATE);
26+
ToneAnalyzer service = new ToneAnalyzer("2017-09-21");
2827
service.setUsernameAndPassword("<username>", "<password>");
2928

3029
String[] texts = {

examples/src/main/java/com/ibm/watson/developer_cloud/tone_analyzer/v3/ToneAnalyzerExample.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
package com.ibm.watson.developer_cloud.tone_analyzer.v3;
1414

1515
import com.ibm.watson.developer_cloud.tone_analyzer.v3.model.ToneAnalysis;
16+
import com.ibm.watson.developer_cloud.tone_analyzer.v3.model.ToneOptions;
1617

1718
public class ToneAnalyzerExample {
1819

1920

2021
public static void main(String[] args) {
21-
final String VERSION_DATE = "2016-05-19";
22-
ToneAnalyzer service = new ToneAnalyzer(VERSION_DATE);
22+
ToneAnalyzer service = new ToneAnalyzer("2017-09-21");
2323
service.setUsernameAndPassword("<username>", "<password>");
2424

2525
String text = "I know the times are difficult! Our sales have been "
@@ -33,8 +33,10 @@ public static void main(String[] args) {
3333
+ "business outcomes. Economy has nothing to do with it.";
3434

3535
// Call the service and get the tone
36-
ToneOptions tonOptions = new ToneOptions.Builder().text(text).build();
37-
ToneAnalysis tone = service.tone(tonOptions).execute();
36+
ToneOptions toneOptions = new ToneOptions.Builder()
37+
.text(text)
38+
.build();
39+
ToneAnalysis tone = service.tone(toneOptions).execute();
3840
System.out.println(tone);
3941

4042
}

0 commit comments

Comments
 (0)