Skip to content

Commit 681ce62

Browse files
Merge pull request #836 from watson-developer-cloud/develop
Release v4.2.0
2 parents 53778c4 + 3d3abc3 commit 681ce62

File tree

18 files changed

+1282
-248
lines changed

18 files changed

+1282
-248
lines changed

.bumpversion.cfg

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
[bumpversion]
22
current_version = 4.1.0
3-
commit = True
4-
tag = True
53

64
[bumpversion:file:README.md]
75

@@ -34,4 +32,3 @@ tag = True
3432
[bumpversion:file:visual-recognition/README.md]
3533
search = {current_version}
3634
replace = {new_version}
37-

.travis.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ deploy:
4747
on:
4848
repo: watson-developer-cloud/java-sdk
4949
jdk: oraclejdk7
50+
tags: true
5051

5152
- provider: script
5253
script: .utility/deploy.sh
@@ -55,5 +56,13 @@ deploy:
5556
repo: watson-developer-cloud/java-sdk
5657
jdk: oraclejdk7
5758

59+
- provider: releases
60+
api_key: ${GITHUB_TOKEN_RELEASES}
61+
file: java-sdk/build/libs/jar-with-dependencies-${TRAVIS_BRANCH}.jar
62+
skip_cleanup: true
63+
on:
64+
repo: watson-developer-cloud/java-sdk
65+
jdk: oraclejdk7
66+
tags: true
5867
notifications:
5968
email: true

core/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ dependencies {
7575
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.0'
7676
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.5'
7777
compile group: 'org.glassfish.jersey.bundles.repackaged', name: 'jersey-jsr166e', version: '2.25.1'
78+
testCompile group: 'simple-jndi', name: 'simple-jndi', version: '0.11.4.1'
7879

7980
signature 'org.codehaus.mojo.signature:java17:1.0@signature'
8081

core/src/test/java/com/ibm/watson/developer_cloud/util/CredentialUtilsTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import static org.junit.Assert.assertEquals;
1616
import static org.junit.Assert.assertNull;
1717
import static org.junit.Assert.assertTrue;
18-
import static org.junit.Assume.assumeTrue;
1918

2019
import java.io.InputStream;
2120
import java.util.Hashtable;
@@ -131,7 +130,6 @@ public void testGetUserCredentialsWithPlan() {
131130
*/
132131
@Test
133132
public void testGetAPIUrlFromJDNI() {
134-
assumeTrue(!System.getenv().containsKey("TRAVIS"));
135133
assertEquals(CredentialUtils.getAPIUrlTest(SERVICE_NAME), PERSONALITY_INSIGHTS_URL);
136134
}
137135
}

discovery/src/main/java/com/ibm/watson/developer_cloud/discovery/v1/model/Enrichment.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ public Boolean isOverwrite() {
8181
/**
8282
* Gets the enrichmentName.
8383
*
84-
* Name of the enrichment service to call. Currently the only valid value is `alchemy_language`.
84+
* Name of the enrichment service to call. Currently the only valid value is `natural_language_understanding`.
85+
* Previous API versions also supported `alchemy_language`.
8586
*
8687
* @return the enrichmentName
8788
*/
@@ -104,7 +105,7 @@ public Boolean isIgnoreDownstreamErrors() {
104105
/**
105106
* Gets the options.
106107
*
107-
* A list of options specific to the enrichment
108+
* A list of options specific to the enrichment.
108109
*
109110
* @return the options
110111
*/

discovery/src/main/java/com/ibm/watson/developer_cloud/discovery/v1/model/EnrichmentOptions.java

Lines changed: 45 additions & 191 deletions
Original file line numberDiff line numberDiff line change
@@ -12,219 +12,73 @@
1212
*/
1313
package com.ibm.watson.developer_cloud.discovery.v1.model;
1414

15-
import java.util.List;
16-
1715
import com.ibm.watson.developer_cloud.service.model.GenericModel;
1816

1917
/**
2018
* Options which are specific to a particular enrichment.
2119
*/
2220
public class EnrichmentOptions extends GenericModel {
2321

24-
/**
25-
* If provided, then do not attempt to detect the language of the input document. Instead, assume the language is the
26-
* one specified in this field. You can set this property to work around `unsupported-text-language` errors. Supported
27-
* languages include English, German, French, Italian, Portuguese, Russian, Spanish and Swedish. Supported language
28-
* codes are the ISO-639-1, ISO-639-2, ISO-639-3, and the plain english name of the language (for example "russian").
29-
*/
30-
public interface Language {
31-
/** english. */
32-
String ENGLISH = "english";
33-
/** german. */
34-
String GERMAN = "german";
35-
/** french. */
36-
String FRENCH = "french";
37-
/** italian. */
38-
String ITALIAN = "italian";
39-
/** portuguese. */
40-
String PORTUGUESE = "portuguese";
41-
/** russian. */
42-
String RUSSIAN = "russian";
43-
/** spanish. */
44-
String SPANISH = "spanish";
45-
/** swedish. */
46-
String SWEDISH = "swedish";
47-
/** en. */
48-
String EN = "en";
49-
/** eng. */
50-
String ENG = "eng";
51-
/** de. */
52-
String DE = "de";
53-
/** ger. */
54-
String GER = "ger";
55-
/** deu. */
56-
String DEU = "deu";
57-
/** fr. */
58-
String FR = "fr";
59-
/** fre. */
60-
String FRE = "fre";
61-
/** fra. */
62-
String FRA = "fra";
63-
/** it. */
64-
String IT = "it";
65-
/** ita. */
66-
String ITA = "ita";
67-
/** pt. */
68-
String PT = "pt";
69-
/** por. */
70-
String POR = "por";
71-
/** ru. */
72-
String RU = "ru";
73-
/** rus. */
74-
String RUS = "rus";
75-
/** es. */
76-
String ES = "es";
77-
/** spa. */
78-
String SPA = "spa";
79-
/** sv. */
80-
String SV = "sv";
81-
/** swe. */
82-
String SWE = "swe";
83-
}
84-
85-
private List<String> extract;
86-
private Boolean sentiment;
87-
private Boolean quotations;
88-
private Boolean showSourceText;
89-
private Boolean hierarchicalTypedRelations;
90-
private String model;
91-
private String language;
92-
93-
/**
94-
* Gets the extract.
95-
*
96-
* A comma-separated list of analyses that will be applied when using the `alchemy_language` enrichment. See the
97-
* service documentation for details on each extract option. Possible values include: * entity * keyword * taxonomy *
98-
* concept * relation * doc-sentiment * doc-emotion * typed-rels
99-
*
100-
* @return the extract
101-
*/
102-
public List<String> getExtract() {
103-
return extract;
104-
}
22+
private NluEnrichmentFeatures features;
10523

10624
/**
107-
* Gets the sentiment.
108-
*
109-
* @return the sentiment
25+
* Builder.
11026
*/
111-
public Boolean isSentiment() {
112-
return sentiment;
27+
public static class Builder {
28+
private NluEnrichmentFeatures features;
29+
30+
private Builder(EnrichmentOptions enrichmentOptions) {
31+
features = enrichmentOptions.features;
32+
}
33+
34+
/**
35+
* Instantiates a new builder.
36+
*/
37+
public Builder() {
38+
}
39+
40+
/**
41+
* Builds a EnrichmentOptions.
42+
*
43+
* @return the enrichmentOptions
44+
*/
45+
public EnrichmentOptions build() {
46+
return new EnrichmentOptions(this);
47+
}
48+
49+
/**
50+
* Set the features.
51+
*
52+
* @param features the features
53+
* @return the EnrichmentOptions builder
54+
*/
55+
public Builder features(NluEnrichmentFeatures features) {
56+
this.features = features;
57+
return this;
58+
}
11359
}
11460

115-
/**
116-
* Gets the quotations.
117-
*
118-
* @return the quotations
119-
*/
120-
public Boolean isQuotations() {
121-
return quotations;
61+
private EnrichmentOptions(Builder builder) {
62+
features = builder.features;
12263
}
12364

12465
/**
125-
* Gets the showSourceText.
66+
* New builder.
12667
*
127-
* @return the showSourceText
68+
* @return a EnrichmentOptions builder
12869
*/
129-
public Boolean isShowSourceText() {
130-
return showSourceText;
70+
public Builder newBuilder() {
71+
return new Builder(this);
13172
}
13273

13374
/**
134-
* Gets the hierarchicalTypedRelations.
75+
* Gets the features.
13576
*
136-
* @return the hierarchicalTypedRelations
137-
*/
138-
public Boolean isHierarchicalTypedRelations() {
139-
return hierarchicalTypedRelations;
140-
}
141-
142-
/**
143-
* Gets the model.
144-
*
145-
* Required when using the `typed-rel` extract option. Should be set to the ID of a previously published custom Watson
146-
* Knowledge Studio model.
147-
*
148-
* @return the model
149-
*/
150-
public String getModel() {
151-
return model;
152-
}
153-
154-
/**
155-
* Gets the language.
156-
*
157-
* If provided, then do not attempt to detect the language of the input document. Instead, assume the language is the
158-
* one specified in this field. You can set this property to work around `unsupported-text-language` errors. Supported
159-
* languages include English, German, French, Italian, Portuguese, Russian, Spanish and Swedish. Supported language
160-
* codes are the ISO-639-1, ISO-639-2, ISO-639-3, and the plain english name of the language (for example "russian").
161-
*
162-
* @return the language
163-
*/
164-
public String getLanguage() {
165-
return language;
166-
}
167-
168-
/**
169-
* Sets the extract.
170-
*
171-
* @param extract the new extract
172-
*/
173-
public void setExtract(final List<String> extract) {
174-
this.extract = extract;
175-
}
176-
177-
/**
178-
* Sets the sentiment.
179-
*
180-
* @param sentiment the new sentiment
181-
*/
182-
public void setSentiment(final Boolean sentiment) {
183-
this.sentiment = sentiment;
184-
}
185-
186-
/**
187-
* Sets the quotations.
188-
*
189-
* @param quotations the new quotations
190-
*/
191-
public void setQuotations(final Boolean quotations) {
192-
this.quotations = quotations;
193-
}
194-
195-
/**
196-
* Sets the showSourceText.
197-
*
198-
* @param showSourceText the new showSourceText
199-
*/
200-
public void setShowSourceText(final Boolean showSourceText) {
201-
this.showSourceText = showSourceText;
202-
}
203-
204-
/**
205-
* Sets the hierarchicalTypedRelations.
206-
*
207-
* @param hierarchicalTypedRelations the new hierarchicalTypedRelations
208-
*/
209-
public void setHierarchicalTypedRelations(final Boolean hierarchicalTypedRelations) {
210-
this.hierarchicalTypedRelations = hierarchicalTypedRelations;
211-
}
212-
213-
/**
214-
* Sets the model.
215-
*
216-
* @param model the new model
217-
*/
218-
public void setModel(final String model) {
219-
this.model = model;
220-
}
221-
222-
/**
223-
* Sets the language.
77+
* An object representing the enrichment features that will be applied to the specified field.
22478
*
225-
* @param language the new language
79+
* @return the features
22680
*/
227-
public void setLanguage(final String language) {
228-
this.language = language;
81+
public NluEnrichmentFeatures features() {
82+
return features;
22983
}
23084
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright 2017 IBM Corp. All Rights Reserved.
3+
*
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
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
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.
12+
*/
13+
package com.ibm.watson.developer_cloud.discovery.v1.model;
14+
15+
import com.ibm.watson.developer_cloud.service.model.DynamicModel;
16+
17+
/**
18+
* An object that indicates the Categories enrichment will be applied to the specified field.
19+
*/
20+
public class NluEnrichmentCategories extends DynamicModel {
21+
22+
}

0 commit comments

Comments
 (0)