GeezerVison is showing github.com — Add fixes for Speech and Visual Recognition · morristech/java-sdk@9a0ede8
File treeExpand file treeCollapse file tree Open diff view settings core/src/main/java/com/ibm/watson/developer_cloud/http main/java/com/ibm/watson/developer_cloud/speech_to_text/v1 test/java/com/ibm/watson/developer_cloud/speech_to_text/v1
main/java/com/ibm/watson/developer_cloud/visual_recognition/v3 test/java/com/ibm/watson/developer_cloud/visual_recognition/v3
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: .travis.yml +16-3Lines changed: 16 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -39,8 +39,21 @@ script: | 39 | 39 |
| 40 | 40 | after_success: | 41 | 41 | - bash <(curl -s https://codecov.io/bash) | 42 | | - - .utility/push-javadoc-to-gh-pages.sh | 43 | | - - .utility/deploy.sh | | 42 | + | | 43 | +deploy: | | 44 | + - provider: script | | 45 | + script: .utility/push-javadoc-to-gh-pages.sh | | 46 | + skip_cleanup: true | | 47 | + on: | | 48 | + repo: watson-developer-cloud/java-sdk | | 49 | + jdk: oraclejdk7 | | 50 | + | | 51 | + - provider: script | | 52 | + script: .utility/deploy.sh | | 53 | + skip_cleanup: true | | 54 | + on: | | 55 | + repo: watson-developer-cloud/java-sdk | | 56 | + jdk: oraclejdk7 | 44 | 57 |
| 45 | 58 | notifications: | 46 | | - email: false | | 59 | + email: true |
Collapse file Copy file name to clipboard +1-4Lines changed: 1 addition & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | #!/usr/bin/env bash | 2 | 2 |
| 3 | | -if [ "$TRAVIS_REPO_SLUG" == "watson-developer-cloud/java-sdk" ] && \ | 4 | | - [ "$TRAVIS_JDK_VERSION" == "oraclejdk7" ] && \ | 5 | | - [ "$TRAVIS_PULL_REQUEST" == "false" ] && \ | 6 | | - [ "$TRAVIS_BRANCH" == "master" ]; then | | 3 | +if [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then | 7 | 4 | openssl aes-256-cbc -K $encrypted_bdb9d73a7940_key -iv $encrypted_bdb9d73a7940_iv -in .utility/cd/secring.gpg.enc -out .utility/cd/secring.gpg -d | 8 | 5 | ./gradlew uploadArchives -Psigning.keyId=$SIGNING_KEY -Psigning.password=$SIGNING_PASSWORD -Psigning.secretKeyRingFile=$KEYRING_PATH -PossrhUsername=$OSSRH_JIRA_USERNAME -PossrhPassword=$OSSRH_JIRA_PASSWORD | 9 | 6 | fi |
Collapse file Copy file name to clipboardExpand all lines: .utility/push-javadoc-to-gh-pages.sh +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | #!/bin/bash | 2 | 2 |
| 3 | | -if [ "$TRAVIS_REPO_SLUG" == "watson-developer-cloud/java-sdk" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" ] && [ "$TRAVIS_BUILD_NUMBER.1" == "$TRAVIS_JOB_NUMBER" ]; then | | 3 | +if [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" ]; then | 4 | 4 |
| 5 | 5 | | 6 | 6 | git config --global user.name "Watson Github Bot" | |
Collapse file Copy file name to clipboardExpand all lines: core/src/main/java/com/ibm/watson/developer_cloud/http/HttpMediaType.java +15Lines changed: 15 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -120,6 +120,21 @@ private HttpMediaType() { | 120 | 120 | public static final String AUDIO_FLAC = "audio/flac"; | 121 | 121 |
| 122 | 122 | /** | | 123 | + * Field AUDIO_MULAW. (value is "audio/mulaw") | | 124 | + */ | | 125 | + public static final String AUDIO_MULAW = "audio/mulaw"; | | 126 | + | | 127 | + /** | | 128 | + * Field AUDIO_MP3. (value is "audio/mp3") | | 129 | + */ | | 130 | + public static final String AUDIO_MP3 = "audio/mp3"; | | 131 | + | | 132 | + /** | | 133 | + * Field AUDIO_MPEG. (value is "audio/mpeg") | | 134 | + */ | | 135 | + public static final String AUDIO_MPEG = "audio/mpeg"; | | 136 | + | | 137 | + /** | 123 | 138 | * Field AUDIO_RAW. (value is "audio/l16") <br> | 124 | 139 | * When using in Speech to Text a sample rate must be provided | 125 | 140 | */ | |
Collapse file Copy file name to clipboardExpand all lines: speech-to-text/README.md -1Lines changed: 0 additions & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -41,7 +41,6 @@ service.setUsernameAndPassword("<username>", "<password>"); | 41 | 41 | File audio = new File("src/test/resources/sample1.wav"); | 42 | 42 |
| 43 | 43 | RecognizeOptions options = new RecognizeOptions.Builder() | 44 | | - .continuous(true) | 45 | 44 | .interimResults(true) | 46 | 45 | .contentType(HttpMediaType.AUDIO_WAV) | 47 | 46 | .build(); | |
Collapse file Copy file name to clipboardExpand all lines: speech-to-text/src/main/java/com/ibm/watson/developer_cloud/speech_to_text/v1/SpeechToText.java +17-1Lines changed: 17 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -366,9 +366,10 @@ public ServiceCall<Void> addWords(String customizationId, Word... words) { | 366 | 366 | * @param baseModel The name of the language model that is to be customized by the new model. e.g: | 367 | 367 | * 'en-US_BroadbandModel'. | 368 | 368 | * @param description the customization description | | 369 | + * @param dialect the language dialect | 369 | 370 | * @return the service call with the GUID which identifies the created custom model. | 370 | 371 | */ | 371 | | - public ServiceCall<Customization> createCustomization(String name, SpeechModel baseModel, String description) { | | 372 | + public ServiceCall<Customization> createCustomization(String name, SpeechModel baseModel, String description, String dialect) { | 372 | 373 | Validator.notNull(name, "name cannot be null"); | 373 | 374 | Validator.notNull(baseModel, "baseModel cannot be null"); | 374 | 375 |
| @@ -378,9 +379,24 @@ public ServiceCall<Customization> createCustomization(String name, SpeechModel b | 378 | 379 | newCustomization.setBaseModelName(baseModel.getName()); | 379 | 380 | newCustomization.setDescription(description); | 380 | 381 | newCustomization.setName(name); | | 382 | + if (dialect != null) | | 383 | + newCustomization.setDialect(dialect); | 381 | 384 | requestBuilder.bodyContent(GSON.toJson(newCustomization), HttpMediaType.APPLICATION_JSON); | 382 | 385 | return createServiceCall(requestBuilder.build(), ResponseConverterUtils.getObject(Customization.class)); | 383 | 386 | } | | 387 | + | | 388 | + /** | | 389 | + * Creates the customization. | | 390 | + * | | 391 | + * @param name The customization name | | 392 | + * @param baseModel The name of the language model that is to be customized by the new model. e.g: | | 393 | + * 'en-US_BroadbandModel'. | | 394 | + * @param description the customization description | | 395 | + * @return the service call with the GUID which identifies the created custom model. | | 396 | + */ | | 397 | + public ServiceCall<Customization> createCustomization(String name, SpeechModel baseModel, String description) { | | 398 | + return createCustomization(name, baseModel, description, null); | | 399 | + } | 384 | 400 |
| 385 | 401 | /** | 386 | 402 | * Creates an asynchronous recognition request. | |
Collapse file Copy file name to clipboardExpand all lines: speech-to-text/src/main/java/com/ibm/watson/developer_cloud/speech_to_text/v1/model/Customization.java +27-5Lines changed: 27 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -33,6 +33,8 @@ public class Customization extends GenericModel { | 33 | 33 | * </ul> | 34 | 34 | */ | 35 | 35 | public enum WordTypeToAdd { | | 36 | + | | 37 | + /** The all. */ | 36 | 38 | ALL, /** The corpora and user words. */ | 37 | 39 | USER /** The user words. */ | 38 | 40 | } | @@ -59,7 +61,7 @@ public enum Status { | 59 | 61 | } | 60 | 62 |
| 61 | 63 | @SerializedName("customization_id") | 62 | | - private String customizationId; | | 64 | + private String id; | 63 | 65 |
| 64 | 66 | private Date created; | 65 | 67 |
| @@ -80,22 +82,42 @@ public enum Status { | 80 | 82 |
| 81 | 83 | private String warnings; | 82 | 84 |
| | 85 | + private String dialect; | | 86 | + | 83 | 87 | /** | 84 | 88 | * Gets the customization id. | 85 | 89 | * | 86 | 90 | * @return The customizationId | 87 | 91 | */ | 88 | 92 | public String getId() { | 89 | | - return customizationId; | | 93 | + return id; | | 94 | + } | | 95 | + | | 96 | + /** | | 97 | + * Gets the dialect of the language that is to be used with the custom model. | | 98 | + * | | 99 | + * @return the dialect | | 100 | + */ | | 101 | + public String getDialect() { | | 102 | + return dialect; | | 103 | + } | | 104 | + | | 105 | + /** | | 106 | + * Sets the dialect of the language that is to be used with the custom model. | | 107 | + * | | 108 | + * @param dialect the new dialect | | 109 | + */ | | 110 | + public void setDialect(String dialect) { | | 111 | + this.dialect = dialect; | 90 | 112 | } | 91 | 113 |
| 92 | 114 | /** | 93 | 115 | * Sets the customization id. | 94 | 116 | * | 95 | | - * @param customizationId The customization_id | | 117 | + * @param id The customization id | 96 | 118 | */ | 97 | | - public void setId(String customizationId) { | 98 | | - this.customizationId = customizationId; | | 119 | + public void setId(String id) { | | 120 | + this.id = id; | 99 | 121 | } | 100 | 122 |
| 101 | 123 | /** | |
Collapse file Copy file name to clipboardExpand all lines: speech-to-text/src/main/java/com/ibm/watson/developer_cloud/speech_to_text/v1/model/RecognizeOptions.java +8-3Lines changed: 8 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -86,11 +86,14 @@ public RecognizeOptions build() { | 86 | 86 | * The format of the audio data specified as one of the following values: <br> | 87 | 87 | * <ul> | 88 | 88 | * <li><code>audio/flac</code> for Free Lossless Audio Codec (FLAC)</li> | 89 | | - * <li><code>audio/l16</code> for Linear 16-bit Pulse-Code Modulation (PCM).</li> | | 89 | + * <li><code>audio/l16</code> for Linear 16-bit Pulse-Code Modulation (PCM)</li> | | 90 | + * <li><code>audio/mp3</code> for MP3</li> | | 91 | + * <li><code>audio/mpeg</code> for MPEG-1</li> | | 92 | + * <li><code>audio/mulaw</code> for Mulaw</li> | | 93 | + * <li><code>audio/webm</code> for Webm</li> | 90 | 94 | * <li><code>audio/wav</code> for Waveform Audio File Format (WAV)</li> | 91 | | - * <li><code>audio/ogg;codecs=opus</code> for Ogg format files that use the opus codec</li> | | 95 | + * <li><code>audio/ogg;codecs=opus</code> for OGG format files that use the opus codec</li> | 92 | 96 | * </ul> | 93 | | - * . | 94 | 97 | * | 95 | 98 | * @param contentType the content type | 96 | 99 | * @return the recognize options | @@ -146,9 +149,11 @@ public Builder profanityFilter(Boolean profanityFilter) { | 146 | 149 | } | 147 | 150 |
| 148 | 151 | /** | | 152 | + * | 149 | 153 | * If true, multiple final results that represent multiple consecutive phrases separated by pauses are returned. | 150 | 154 | * Otherwise, the recognition ends after first "end of speech" is detected. | 151 | 155 | * | | 156 | + * @deprecated | 152 | 157 | * @param continuous the continuous | 153 | 158 | * @return the recognize options | 154 | 159 | */ | |
Collapse file Copy file name to clipboardExpand all lines: speech-to-text/src/main/java/com/ibm/watson/developer_cloud/speech_to_text/v1/model/SpeechModel.java +11-1Lines changed: 11 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -74,9 +74,19 @@ public void setSpeakerLabels(final Boolean speakerLabels) { | 74 | 74 | public static final SpeechModel AR_AR_BROADBANDMODEL = new SpeechModel("ar-AR_BroadbandModel"); | 75 | 75 |
| 76 | 76 | /** UK English broadband model. */ | 77 | | - public static final SpeechModel EN_UK_BROADBANDMODEL = new SpeechModel("en-UK_BroadbandModel"); | | 77 | + public static final SpeechModel EN_GB_BROADBANDMODEL = new SpeechModel("en-GB_BroadbandModel"); | 78 | 78 |
| 79 | 79 | /** UK English narrowband model. */ | | 80 | + public static final SpeechModel EN_GB_NARROWBANDMODEL = new SpeechModel("en-GB_NarrowbandModel"); | | 81 | + | | 82 | + /** | | 83 | + * @deprecated Use {@link SpeechModel#EN_GB_BROADBANDMODEL}. | | 84 | + */ | | 85 | + public static final SpeechModel EN_UK_BROADBANDMODEL = new SpeechModel("en-UK_BroadbandModel"); | | 86 | + | | 87 | + /** | | 88 | + * @deprecated Use {@link SpeechModel#EN_GB_NARROWBANDMODEL}. | | 89 | + */ | 80 | 90 | public static final SpeechModel EN_UK_NARROWBANDMODEL = new SpeechModel("en-UK_NarrowbandModel"); | 81 | 91 |
| 82 | 92 | /** US English broadband model. */ | |
Collapse file Copy file name to clipboardExpand all lines: speech-to-text/src/main/java/com/ibm/watson/developer_cloud/speech_to_text/v1/util/MediaTypeUtils.java +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -36,6 +36,8 @@ public final class MediaTypeUtils { | 36 | 36 | MEDIA_TYPES.put(".oga", HttpMediaType.AUDIO_OGG); | 37 | 37 | MEDIA_TYPES.put(".flac", HttpMediaType.AUDIO_FLAC); | 38 | 38 | MEDIA_TYPES.put(".raw", HttpMediaType.AUDIO_RAW); | | 39 | + MEDIA_TYPES.put(".mp3", HttpMediaType.AUDIO_MP3); | | 40 | + MEDIA_TYPES.put(".mpeg", HttpMediaType.AUDIO_MPEG); | 39 | 41 | MEDIA_TYPES.put(".webm", HttpMediaType.AUDIO_WEBM); | 40 | 42 | } | 41 | 43 |
| |
|