Skip to content

Commit a1278d2

Browse files
[ci skip] 📝 update examples
1 parent 56c1e8e commit a1278d2

31 files changed

+374
-516
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ _2016-09-07_
1010
For example, in order to use Retrieve and Rank in Gradle you need:
1111

1212
```gradle
13-
'com.ibm.watson.developer_cloud:retrieve-and-rank:3.3.1'
13+
'com.ibm.watson.developer_cloud:retrieve-and-rank:3.4.0'
1414
```
1515

1616
* New: Move to a maven multi-module project

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ All the services:
4848
<dependency>
4949
<groupId>com.ibm.watson.watson.developer_cloud</groupId>
5050
<artifactId>java-sdk</artifactId>
51-
<version>3.3.1</version>
51+
<version>3.4.0</version>
5252
</dependency>
5353
```
5454

@@ -57,25 +57,25 @@ Only Retrieve and Rank:
5757
<dependency>
5858
<groupId>com.ibm.watson.watson.developer_cloud</groupId>
5959
<artifactId>retrieve-and-rank</artifactId>
60-
<version>3.3.1</version>
60+
<version>3.4.0</version>
6161
</dependency>
6262
```
6363

6464
##### Gradle
6565

6666
All the services:
6767
```gradle
68-
'com.ibm.watson.developer_cloud:java-sdk:3.3.1'
68+
'com.ibm.watson.developer_cloud:java-sdk:3.4.0'
6969
```
7070

7171
Only Retrieve and Rank:
7272
```gradle
73-
'com.ibm.watson.developer_cloud:retrieve-and-rank:3.3.1'
73+
'com.ibm.watson.developer_cloud:retrieve-and-rank:3.4.0'
7474
```
7575

7676
Only Visual Recognition:
7777
```gradle
78-
'com.ibm.watson.developer_cloud:visual-recognition:3.3.1'
78+
'com.ibm.watson.developer_cloud:visual-recognition:3.4.0'
7979
```
8080

8181
Snapshots of the development version are available in [Sonatype's snapshots repository][sonatype_snapshots].
@@ -613,7 +613,7 @@ Gradle:
613613

614614
```sh
615615
$ cd java-sdk
616-
$ gradle jar # build jar file (build/libs/watson-developer-cloud-3.3.1.jar)
616+
$ gradle jar # build jar file (build/libs/watson-developer-cloud-3.4.0.jar)
617617
$ gradle test # run tests
618618
```
619619

@@ -680,4 +680,4 @@ See [CONTRIBUTING.md](.github/CONTRIBUTING.md).
680680
[apache_maven]: http://maven.apache.org/
681681
[sonatype_snapshots]: https://oss.sonatype.org/content/repositories/snapshots/com/ibm/watson/watson.developer_cloud/
682682

683-
[jar]: https://github.com/watson-developer-cloud/java-sdk/releases/download/java-sdk-3.3.1/java-sdk-3.3.1-jar-with-dependencies.jar
683+
[jar]: https://github.com/watson-developer-cloud/java-sdk/releases/download/java-sdk-3.4.0/java-sdk-3.4.0-jar-with-dependencies.jar

build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ apply plugin: 'maven'
33
apply plugin: 'eclipse'
44
apply plugin: 'idea'
55

6-
sourceCompatibility = 1.6
7-
targetCompatibility = 1.6
6+
sourceCompatibility = 1.7
7+
targetCompatibility = 1.7
88
group = 'com.ibm.watson.developercloud'
99
archivesBaseName = 'watson-developer-cloud'
10-
version = '3.3.1'
10+
version = '3.3.4'
1111

1212
description = 'Client library to use the IBM Watson and Alchemy Services'
1313

examples/java/com/ibm/watson/developer_cloud/alchemy_data_news/v1/GetNewsDocumentExample.java

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
/**
22
* Copyright 2015 IBM Corp. All Rights Reserved.
33
*
4-
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5-
* in compliance with the License. You may obtain a copy of the License at
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
5+
* the License. You may obtain a copy of the License at
66
*
77
* http://www.apache.org/licenses/LICENSE-2.0
88
*
9-
* Unless required by applicable law or agreed to in writing, software distributed under the License
10-
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11-
* or implied. See the License for the specific language governing permissions and limitations under
12-
* the License.
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
10+
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
11+
* specific language governing permissions and limitations under the License.
1312
*/
1413
package com.ibm.watson.developer_cloud.alchemy_data_news.v1;
1514

@@ -19,14 +18,14 @@
1918

2019
import org.apache.commons.lang3.StringUtils;
2120

22-
import alchemy_data_news.v1.AlchemyDataNews;
23-
import alchemy_data_news.v1.model.DocumentsResult;
21+
import com.ibm.watson.developer_cloud.alchemy.v1.AlchemyDataNews;
22+
import com.ibm.watson.developer_cloud.alchemy.v1.model.DocumentsResult;
2423

2524

2625
/**
27-
* Getting 7 documents between Friday 28th August 2015 and Friday 4th September 2015 using the
28-
* {@link AlchemyDataNews} API.
29-
*
26+
* Getting 7 documents between Friday 28th August 2015 and Friday 4th September 2015 using the {@link AlchemyDataNews}
27+
* API.
28+
*
3029
* Example from java-sdk: https://github.com/watson-developer-cloud/java-sdk
3130
*/
3231
public class GetNewsDocumentExample {
@@ -38,15 +37,14 @@ public static void main(String[] args) {
3837
Map<String, Object> params = new HashMap<String, Object>();
3938

4039
String[] fields =
41-
new String[] {"enriched.url.title", "enriched.url.url", "enriched.url.author",
42-
"enriched.url.publicationDate", "enriched.url.enrichedTitle.entities",
43-
"enriched.url.enrichedTitle.docSentiment"};
40+
new String[] { "enriched.url.title", "enriched.url.url", "enriched.url.author", "enriched.url.publicationDate",
41+
"enriched.url.enrichedTitle.entities", "enriched.url.enrichedTitle.docSentiment"};
4442
params.put(AlchemyDataNews.RETURN, StringUtils.join(fields, ","));
4543
params.put(AlchemyDataNews.START, "1440720000");
4644
params.put(AlchemyDataNews.END, "1441407600");
4745
params.put(AlchemyDataNews.COUNT, 7);
4846

49-
//Query on adjacent nested fields:
47+
// Query on adjacent nested fields:
5048
params.put("q.enriched.url.enrichedTitle.entities.entity", "|text=IBM,type=company|");
5149
params.put("q.enriched.url.enrichedTitle.docSentiment.type", "positive");
5250
params.put("q.enriched.url.enrichedTitle.taxonomy.taxonomy_.label", "technology and computing");

examples/java/com/ibm/watson/developer_cloud/alchemy_data_news/v1/GetVolumeExample.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
/**
22
* Copyright 2015 IBM Corp. All Rights Reserved.
33
*
4-
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5-
* in compliance with the License. You may obtain a copy of the License at
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
5+
* the License. You may obtain a copy of the License at
66
*
77
* http://www.apache.org/licenses/LICENSE-2.0
88
*
9-
* Unless required by applicable law or agreed to in writing, software distributed under the License
10-
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11-
* or implied. See the License for the specific language governing permissions and limitations under
12-
* the License.
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
10+
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
11+
* specific language governing permissions and limitations under the License.
1312
*/
1413
package com.ibm.watson.developer_cloud.alchemy_data_news.v1;
1514

@@ -18,8 +17,8 @@
1817
import com.ibm.watson.developer_cloud.alchemy.v1.model.VolumeResult;
1918

2019
/**
21-
* Getting The number for ingested documents in the last 7 days with a 12 hour period using the
22-
* {@link AlchemyDataNews} API.
20+
* Getting The number for ingested documents in the last 7 days with a 12 hour period using the {@link AlchemyDataNews}
21+
* API.
2322
*
2423
*/
2524
public class GetVolumeExample {
Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,25 @@
11
/**
22
* Copyright 2015 IBM Corp. All Rights Reserved.
33
*
4-
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5-
* in compliance with the License. You may obtain a copy of the License at
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
5+
* the License. You may obtain a copy of the License at
66
*
77
* http://www.apache.org/licenses/LICENSE-2.0
88
*
9-
* Unless required by applicable law or agreed to in writing, software distributed under the License
10-
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11-
* or implied. See the License for the specific language governing permissions and limitations under
12-
* the License.
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
10+
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
11+
* specific language governing permissions and limitations under the License.
1312
*/
1413
package com.ibm.watson.developer_cloud.alchemy_language.v1;
1514

1615

1716
import java.util.HashMap;
1817
import java.util.Map;
1918

20-
import alchemy_language.v1.AlchemyLanguage;
21-
import alchemy_language.v1.model.DocumentSentiment;
22-
import alchemy_language.v1.model.Entities;
23-
import alchemy_language.v1.model.TypedRelations;
19+
import com.ibm.watson.developer_cloud.alchemy.v1.AlchemyLanguage;
20+
import com.ibm.watson.developer_cloud.alchemy.v1.model.DocumentSentiment;
21+
import com.ibm.watson.developer_cloud.alchemy.v1.model.Entities;
22+
import com.ibm.watson.developer_cloud.alchemy.v1.model.TypedRelations;
2423

2524
public class AlchemyLanguageExample {
2625

@@ -29,21 +28,20 @@ public static void main(String[] args) {
2928
service.setApiKey("<api_key>");
3029

3130
Map<String, Object> params = new HashMap<String, Object>();
32-
params.put(AlchemyLanguage.TEXT,
33-
"IBM Watson won the Jeopardy television show hosted by Alex Trebek");
31+
params.put(AlchemyLanguage.TEXT, "IBM Watson won the Jeopardy television show hosted by Alex Trebek");
3432

35-
// get sentiment
33+
// get sentiment
3634
DocumentSentiment sentiment = service.getSentiment(params).execute();
3735
System.out.println("Sentiment: " + sentiment);
3836

3937
// get entities
4038
Entities entities = service.getEntities(params).execute();
4139
System.out.println("Entities: " + entities);
42-
40+
4341
// get typed relations
4442
TypedRelations relations = service.getTypedRelations(params).execute();
4543
System.out.println("Relations: " + relations);
46-
44+
4745
}
4846

4947
}

examples/java/com/ibm/watson/developer_cloud/alchemy_vision/v1/ImageKeywordsExample.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
11
/**
22
* Copyright 2015 IBM Corp. All Rights Reserved.
33
*
4-
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5-
* in compliance with the License. You may obtain a copy of the License at
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
5+
* the License. You may obtain a copy of the License at
66
*
77
* http://www.apache.org/licenses/LICENSE-2.0
88
*
9-
* Unless required by applicable law or agreed to in writing, software distributed under the License
10-
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11-
* or implied. See the License for the specific language governing permissions and limitations under
12-
* the License.
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
10+
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
11+
* specific language governing permissions and limitations under the License.
1312
*/
1413
package com.ibm.watson.developer_cloud.alchemy_vision.v1;
1514

1615

1716
import java.io.File;
1817

19-
import alchemy_vision.v1.AlchemyVision;
20-
import alchemy_vision.v1.model.ImageKeywords;
18+
import com.ibm.watson.developer_cloud.alchemy.v1.AlchemyVision;
19+
import com.ibm.watson.developer_cloud.alchemy.v1.model.ImageKeywords;
2120

2221
public class ImageKeywordsExample {
2322

examples/java/com/ibm/watson/developer_cloud/alchemy_vision/v1/RecognizeFacesExample.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
/**
22
* Copyright 2015 IBM Corp. All Rights Reserved.
33
*
4-
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5-
* in compliance with the License. You may obtain a copy of the License at
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
5+
* the License. You may obtain a copy of the License at
66
*
77
* http://www.apache.org/licenses/LICENSE-2.0
88
*
9-
* Unless required by applicable law or agreed to in writing, software distributed under the License
10-
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11-
* or implied. See the License for the specific language governing permissions and limitations under
12-
* the License.
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
10+
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
11+
* specific language governing permissions and limitations under the License.
1312
*/
1413
package com.ibm.watson.developer_cloud.alchemy_vision.v1;
1514

examples/java/com/ibm/watson/developer_cloud/conversation/v1/ConversationExample.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
/*
22
* Copyright 2015 IBM Corp. All Rights Reserved.
33
*
4-
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5-
* in compliance with the License. You may obtain a copy of the License at
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
5+
* the License. You may obtain a copy of the License at
66
*
77
* http://www.apache.org/licenses/LICENSE-2.0
88
*
9-
* Unless required by applicable law or agreed to in writing, software distributed under the License
10-
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11-
* or implied. See the License for the specific language governing permissions and limitations under
12-
* the License.
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
10+
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
11+
* specific language governing permissions and limitations under the License.
1312
*/
1413
package com.ibm.watson.developer_cloud.conversation.v1;
1514

1615
import java.util.Map;
1716

18-
import conversation.v1.model.MessageRequest;
19-
import conversation.v1.model.MessageResponse;
20-
import service_core.http.ServiceCallback;
17+
import com.ibm.watson.developer_cloud.conversation.v1.model.MessageRequest;
18+
import com.ibm.watson.developer_cloud.conversation.v1.model.MessageResponse;
19+
import com.ibm.watson.developer_cloud.http.ServiceCallback;
2120

2221
import jersey.repackaged.jsr166e.CompletableFuture;
2322

2423
/**
25-
* Example of how to call the {@link ConversationService#message(String, MessageRequest)} method
26-
* synchronous, asynchronous, and using react.
24+
* Example of how to call the {@link ConversationService#message(String, MessageRequest)} method synchronous,
25+
* asynchronous, and using react.
26+
*
2727
* @version v1-experimental
2828
*/
2929
public class ConversationExample {

0 commit comments

Comments
 (0)