Skip to content

Commit

Permalink
Merge pull request #836 from watson-developer-cloud/develop
Browse files Browse the repository at this point in the history
Release v4.2.0
  • Loading branch information
germanattanasio authored Dec 15, 2017
2 parents 53778c4 + 3d3abc3 commit 681ce62
Show file tree
Hide file tree
Showing 18 changed files with 1,282 additions and 248 deletions.
3 changes: 0 additions & 3 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
[bumpversion]
current_version = 4.1.0
commit = True
tag = True

[bumpversion:file:README.md]

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

9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ deploy:
on:
repo: watson-developer-cloud/java-sdk
jdk: oraclejdk7
tags: true

- provider: script
script: .utility/deploy.sh
Expand All @@ -55,5 +56,13 @@ deploy:
repo: watson-developer-cloud/java-sdk
jdk: oraclejdk7

- provider: releases
api_key: ${GITHUB_TOKEN_RELEASES}
file: java-sdk/build/libs/jar-with-dependencies-${TRAVIS_BRANCH}.jar
skip_cleanup: true
on:
repo: watson-developer-cloud/java-sdk
jdk: oraclejdk7
tags: true
notifications:
email: true
1 change: 1 addition & 0 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ dependencies {
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.0'
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.5'
compile group: 'org.glassfish.jersey.bundles.repackaged', name: 'jersey-jsr166e', version: '2.25.1'
testCompile group: 'simple-jndi', name: 'simple-jndi', version: '0.11.4.1'

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeTrue;

import java.io.InputStream;
import java.util.Hashtable;
Expand Down Expand Up @@ -131,7 +130,6 @@ public void testGetUserCredentialsWithPlan() {
*/
@Test
public void testGetAPIUrlFromJDNI() {
assumeTrue(!System.getenv().containsKey("TRAVIS"));
assertEquals(CredentialUtils.getAPIUrlTest(SERVICE_NAME), PERSONALITY_INSIGHTS_URL);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ public Boolean isOverwrite() {
/**
* Gets the enrichmentName.
*
* Name of the enrichment service to call. Currently the only valid value is `alchemy_language`.
* Name of the enrichment service to call. Currently the only valid value is `natural_language_understanding`.
* Previous API versions also supported `alchemy_language`.
*
* @return the enrichmentName
*/
Expand All @@ -104,7 +105,7 @@ public Boolean isIgnoreDownstreamErrors() {
/**
* Gets the options.
*
* A list of options specific to the enrichment
* A list of options specific to the enrichment.
*
* @return the options
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,219 +12,73 @@
*/
package com.ibm.watson.developer_cloud.discovery.v1.model;

import java.util.List;

import com.ibm.watson.developer_cloud.service.model.GenericModel;

/**
* Options which are specific to a particular enrichment.
*/
public class EnrichmentOptions extends GenericModel {

/**
* If provided, then do not attempt to detect the language of the input document. Instead, assume the language is the
* one specified in this field. You can set this property to work around `unsupported-text-language` errors. Supported
* languages include English, German, French, Italian, Portuguese, Russian, Spanish and Swedish. Supported language
* codes are the ISO-639-1, ISO-639-2, ISO-639-3, and the plain english name of the language (for example "russian").
*/
public interface Language {
/** english. */
String ENGLISH = "english";
/** german. */
String GERMAN = "german";
/** french. */
String FRENCH = "french";
/** italian. */
String ITALIAN = "italian";
/** portuguese. */
String PORTUGUESE = "portuguese";
/** russian. */
String RUSSIAN = "russian";
/** spanish. */
String SPANISH = "spanish";
/** swedish. */
String SWEDISH = "swedish";
/** en. */
String EN = "en";
/** eng. */
String ENG = "eng";
/** de. */
String DE = "de";
/** ger. */
String GER = "ger";
/** deu. */
String DEU = "deu";
/** fr. */
String FR = "fr";
/** fre. */
String FRE = "fre";
/** fra. */
String FRA = "fra";
/** it. */
String IT = "it";
/** ita. */
String ITA = "ita";
/** pt. */
String PT = "pt";
/** por. */
String POR = "por";
/** ru. */
String RU = "ru";
/** rus. */
String RUS = "rus";
/** es. */
String ES = "es";
/** spa. */
String SPA = "spa";
/** sv. */
String SV = "sv";
/** swe. */
String SWE = "swe";
}

private List<String> extract;
private Boolean sentiment;
private Boolean quotations;
private Boolean showSourceText;
private Boolean hierarchicalTypedRelations;
private String model;
private String language;

/**
* Gets the extract.
*
* A comma-separated list of analyses that will be applied when using the `alchemy_language` enrichment. See the
* service documentation for details on each extract option. Possible values include: * entity * keyword * taxonomy *
* concept * relation * doc-sentiment * doc-emotion * typed-rels
*
* @return the extract
*/
public List<String> getExtract() {
return extract;
}
private NluEnrichmentFeatures features;

/**
* Gets the sentiment.
*
* @return the sentiment
* Builder.
*/
public Boolean isSentiment() {
return sentiment;
public static class Builder {
private NluEnrichmentFeatures features;

private Builder(EnrichmentOptions enrichmentOptions) {
features = enrichmentOptions.features;
}

/**
* Instantiates a new builder.
*/
public Builder() {
}

/**
* Builds a EnrichmentOptions.
*
* @return the enrichmentOptions
*/
public EnrichmentOptions build() {
return new EnrichmentOptions(this);
}

/**
* Set the features.
*
* @param features the features
* @return the EnrichmentOptions builder
*/
public Builder features(NluEnrichmentFeatures features) {
this.features = features;
return this;
}
}

/**
* Gets the quotations.
*
* @return the quotations
*/
public Boolean isQuotations() {
return quotations;
private EnrichmentOptions(Builder builder) {
features = builder.features;
}

/**
* Gets the showSourceText.
* New builder.
*
* @return the showSourceText
* @return a EnrichmentOptions builder
*/
public Boolean isShowSourceText() {
return showSourceText;
public Builder newBuilder() {
return new Builder(this);
}

/**
* Gets the hierarchicalTypedRelations.
* Gets the features.
*
* @return the hierarchicalTypedRelations
*/
public Boolean isHierarchicalTypedRelations() {
return hierarchicalTypedRelations;
}

/**
* Gets the model.
*
* Required when using the `typed-rel` extract option. Should be set to the ID of a previously published custom Watson
* Knowledge Studio model.
*
* @return the model
*/
public String getModel() {
return model;
}

/**
* Gets the language.
*
* If provided, then do not attempt to detect the language of the input document. Instead, assume the language is the
* one specified in this field. You can set this property to work around `unsupported-text-language` errors. Supported
* languages include English, German, French, Italian, Portuguese, Russian, Spanish and Swedish. Supported language
* codes are the ISO-639-1, ISO-639-2, ISO-639-3, and the plain english name of the language (for example "russian").
*
* @return the language
*/
public String getLanguage() {
return language;
}

/**
* Sets the extract.
*
* @param extract the new extract
*/
public void setExtract(final List<String> extract) {
this.extract = extract;
}

/**
* Sets the sentiment.
*
* @param sentiment the new sentiment
*/
public void setSentiment(final Boolean sentiment) {
this.sentiment = sentiment;
}

/**
* Sets the quotations.
*
* @param quotations the new quotations
*/
public void setQuotations(final Boolean quotations) {
this.quotations = quotations;
}

/**
* Sets the showSourceText.
*
* @param showSourceText the new showSourceText
*/
public void setShowSourceText(final Boolean showSourceText) {
this.showSourceText = showSourceText;
}

/**
* Sets the hierarchicalTypedRelations.
*
* @param hierarchicalTypedRelations the new hierarchicalTypedRelations
*/
public void setHierarchicalTypedRelations(final Boolean hierarchicalTypedRelations) {
this.hierarchicalTypedRelations = hierarchicalTypedRelations;
}

/**
* Sets the model.
*
* @param model the new model
*/
public void setModel(final String model) {
this.model = model;
}

/**
* Sets the language.
* An object representing the enrichment features that will be applied to the specified field.
*
* @param language the new language
* @return the features
*/
public void setLanguage(final String language) {
this.language = language;
public NluEnrichmentFeatures features() {
return features;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright 2017 IBM Corp. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package com.ibm.watson.developer_cloud.discovery.v1.model;

import com.ibm.watson.developer_cloud.service.model.DynamicModel;

/**
* An object that indicates the Categories enrichment will be applied to the specified field.
*/
public class NluEnrichmentCategories extends DynamicModel {

}
Loading

0 comments on commit 681ce62

Please sign in to comment.