Skip to content

Commit 85d997a

Browse files
[concept-expansion] updated example and README.md
1 parent e0fbdab commit 85d997a

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -168,17 +168,18 @@ Example: Create a job, wait for it to finish, and then retrieve results.
168168
ConceptExpansion service = new ConceptExpansion();
169169
service.setUsernameAndPassword("<username>", "<password>");
170170

171-
String[] seeds = new String[]{ "motrin", "tylenol", "aspirin"};
172-
String label = "medicine";
171+
String[] seeds = new String[] {"nyc", "dc", "london", "big cities"};
172+
String label = "demo";
173+
173174
Job job = service.createJob(label, seeds);
174175

175176
while (service.getJobStatus(job) == Job.Status.AWAITING_WORK
176-
|| service.getJobStatus(job) == Job.Status.IN_FLIGHT) {
177-
try {
178-
Thread.sleep(4000);
179-
} catch (InterruptedException e) {
180-
e.printStackTrace();
181-
}
177+
|| service.getJobStatus(job) == Job.Status.IN_FLIGHT) {
178+
try {
179+
Thread.sleep(4000);
180+
} catch (final InterruptedException e) {
181+
e.printStackTrace();
182+
}
182183
}
183184

184185
System.out.println(service.getJobResult(job));

examples/java/com/ibm/watson/developer_cloud/concept_expansion/v1/ConceptExpansionExample.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ public class ConceptExpansionExample {
1919

2020

2121
public static void main(String[] args) {
22-
final ConceptExpansion service = new ConceptExpansion();
22+
ConceptExpansion service = new ConceptExpansion();
2323
service.setUsernameAndPassword("<username>", "<password>");
2424

25-
final String[] seeds = new String[] {"nyc", "dc", "london", "big cities"};
26-
final String label = "demo";
25+
String[] seeds = new String[] {"nyc", "dc", "london", "big cities"};
26+
String label = "demo";
2727

28-
final Job job = service.createJob(label, seeds);
28+
Job job = service.createJob(label, seeds);
2929

3030
while (service.getJobStatus(job) == Job.Status.AWAITING_WORK
3131
|| service.getJobStatus(job) == Job.Status.IN_FLIGHT) {
3232
try {
3333
Thread.sleep(4000);
34-
} catch (final InterruptedException e) {
34+
} catch (InterruptedException e) {
3535
e.printStackTrace();
3636
}
3737
}

0 commit comments

Comments
 (0)