Skip to content

Commit

Permalink
Merge pull request #836 from watson-developer-cloud/v0.28
Browse files Browse the repository at this point in the history
Release Candidate for v0.28.0 release
  • Loading branch information
Mike Kistler authored Jun 13, 2018
2 parents b8d5483 + cc8f8be commit ad1e4dc
Show file tree
Hide file tree
Showing 1,413 changed files with 19,786 additions and 12,078 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
Change Log
==========

## Version 0.28.0
_2018-06-12_

This release regenerates all services. It includes updates to the documentation and some minor new service features.

This release includes the following new features and bug fixes:

- Adds support for the new Language Translator V3 service and deprecates Language Translator V2
- Fix for issue 833

## Version 0.27.0
_2018-05-28_

Expand Down
29 changes: 26 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ There are many resources to help you build your first cognitive application with

* [Assistant](#assistant)
* [Discovery](#discovery)
* [Language Translator](#language-translator)
* [Language Translator V2](#language-translator-v2)
* [Language Translator V3](#language-translator-v3)
* [Natural Language Classifier](#natural-language-classifier)
* [Natural Language Understanding](#natural-language-understanding)
* [Personality Insights](#personality-insights)
Expand Down Expand Up @@ -93,7 +94,7 @@ Add the following to your `Package.swift` file to identify the Swift SDK as a de

```swift
dependencies: [
.package(url: "https://github.com/watson-developer-cloud/swift-sdk", from: "0.26.0")
.package(url: "https://github.com/watson-developer-cloud/swift-sdk", from: "0.28.0")
]
```

Expand Down Expand Up @@ -404,7 +405,7 @@ The following links provide more information about the IBM Discovery service:
* [IBM Discovery - Documentation](https://console.bluemix.net/docs/services/discovery/index.html)
* [IBM Discovery - Demo](https://discovery-news-demo.ng.bluemix.net/)

## Language Translator
## Language Translator V2

The IBM Watson Language Translator service lets you select a domain, customize it, then identify or select the language of text, and then translate the text from one supported language to another.

Expand All @@ -425,6 +426,28 @@ languageTranslator.translate(request: request, failure: failure) {
}
```

## Language Translator V3

The IBM Watson Language Translator service lets you select a domain, customize it, then identify or select the language of text, and then translate the text from one supported language to another.

The following example demonstrates how to use the Language Translator service:

```swift
import LanguageTranslatorV3

let username = "your-username-here"
let password = "your-password-here"
let version = "yyyy-mm-dd" // use today's date for the most recent version
let languageTranslator = LanguageTranslator(username: username, password: password, version: version)

let failure = { (error: Error) in print(error) }
let request = TranslateRequest(text: ["Hello"], source: "en", target: "es")
languageTranslator.translate(request: request, failure: failure) {
translation in
print(translation)
}
```

The following links provide more information about the IBM Watson Language Translator service:

* [IBM Watson Language Translator - Service Page](https://www.ibm.com/watson/services/language-translator/)
Expand Down
342 changes: 178 additions & 164 deletions Source/AssistantV1/Assistant.swift

Large diffs are not rendered by default.

14 changes: 11 additions & 3 deletions Source/AssistantV1/Models/CaptureGroup.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,14 @@ import Foundation
/** CaptureGroup. */
public struct CaptureGroup: Codable {

/// A recognized capture group for the entity.
/**
A recognized capture group for the entity.
*/
public var group: String

/// Zero-based character offsets that indicate where the entity value begins and ends in the input text.
/**
Zero-based character offsets that indicate where the entity value begins and ends in the input text.
*/
public var location: [Int]?

// Map each property name to the key that shall be used for encoding/decoding.
Expand All @@ -39,7 +43,11 @@ public struct CaptureGroup: Codable {

- returns: An initialized `CaptureGroup`.
*/
public init(group: String, location: [Int]? = nil) {
public init(
group: String,
location: [Int]? = nil
)
{
self.group = group
self.location = location
}
Expand Down
15 changes: 12 additions & 3 deletions Source/AssistantV1/Models/Context.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,14 @@ import Foundation
/** State information for the conversation. To maintain state, include the context from the previous response. */
public struct Context: Codable {

/// The unique identifier of the conversation.
/**
The unique identifier of the conversation.
*/
public var conversationID: String?

/// For internal use only.
/**
For internal use only.
*/
public var system: SystemResponse?

/// Additional properties associated with this model.
Expand All @@ -43,7 +47,12 @@ public struct Context: Codable {

- returns: An initialized `Context`.
*/
public init(conversationID: String? = nil, system: SystemResponse? = nil, additionalProperties: [String: JSON] = [:]) {
public init(
conversationID: String? = nil,
system: SystemResponse? = nil,
additionalProperties: [String: JSON] = [:]
)
{
self.conversationID = conversationID
self.system = system
self.additionalProperties = additionalProperties
Expand Down
12 changes: 9 additions & 3 deletions Source/AssistantV1/Models/Counterexample.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,19 @@ import Foundation
/** Counterexample. */
public struct Counterexample: Decodable {

/// The text of the counterexample.
/**
The text of the counterexample.
*/
public var text: String

/// The timestamp for creation of the counterexample.
/**
The timestamp for creation of the counterexample.
*/
public var created: String?

/// The timestamp for the last update to the counterexample.
/**
The timestamp for the last update to the counterexample.
*/
public var updated: String?

// Map each property name to the key that shall be used for encoding/decoding.
Expand Down
8 changes: 6 additions & 2 deletions Source/AssistantV1/Models/CounterexampleCollection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,14 @@ import Foundation
/** CounterexampleCollection. */
public struct CounterexampleCollection: Decodable {

/// An array of objects describing the examples marked as irrelevant input.
/**
An array of objects describing the examples marked as irrelevant input.
*/
public var counterexamples: [Counterexample]

/// The pagination data for the returned objects.
/**
The pagination data for the returned objects.
*/
public var pagination: Pagination

// Map each property name to the key that shall be used for encoding/decoding.
Expand Down
17 changes: 14 additions & 3 deletions Source/AssistantV1/Models/CreateCounterexample.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ import Foundation
/** CreateCounterexample. */
public struct CreateCounterexample: Encodable {

/// The text of a user input marked as irrelevant input. This string must conform to the following restrictions: - It cannot contain carriage return, newline, or tab characters - It cannot consist of only whitespace characters - It must be no longer than 1024 characters.
/**
The text of a user input marked as irrelevant input. This string must conform to the following restrictions:
- It cannot contain carriage return, newline, or tab characters
- It cannot consist of only whitespace characters
- It must be no longer than 1024 characters.
*/
public var text: String

// Map each property name to the key that shall be used for encoding/decoding.
Expand All @@ -30,11 +35,17 @@ public struct CreateCounterexample: Encodable {
/**
Initialize a `CreateCounterexample` with member variables.

- parameter text: The text of a user input marked as irrelevant input. This string must conform to the following restrictions: - It cannot contain carriage return, newline, or tab characters - It cannot consist of only whitespace characters - It must be no longer than 1024 characters.
- parameter text: The text of a user input marked as irrelevant input. This string must conform to the following restrictions:
- It cannot contain carriage return, newline, or tab characters
- It cannot consist of only whitespace characters
- It must be no longer than 1024 characters.

- returns: An initialized `CreateCounterexample`.
*/
public init(text: String) {
public init(
text: String
)
{
self.text = text
}

Expand Down
Loading

0 comments on commit ad1e4dc

Please sign in to comment.