Skip to content

Commit

Permalink
fix(discov2,nlu): fix previously breaking changes
Browse files Browse the repository at this point in the history
  • Loading branch information
apaparazzi0329 committed May 27, 2021
1 parent 087faf6 commit 3172384
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
1 change: 1 addition & 0 deletions Sources/DiscoveryV2/Discovery.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1880,6 +1880,7 @@ public class Discovery {
projectID: String,
enrichment: CreateEnrichment,
file: Data? = nil,
fileContentType: String,
headers: [String: String]? = nil,
completionHandler: @escaping (WatsonResponse<Enrichment>?, WatsonError?) -> Void)
{
Expand Down
22 changes: 11 additions & 11 deletions Sources/NaturalLanguageUnderstandingV1/Models/Features.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@ import IBMSwiftSDKCore
*/
public struct Features: Codable, Equatable {

/**
Returns a five-level taxonomy of the content. The top three categories are returned.
Supported languages: Arabic, English, French, German, Italian, Japanese, Korean, Portuguese, Spanish.
*/
public var categories: CategoriesOptions?

/**
Returns text classifications for the content.
Supported languages: English only.
Expand Down Expand Up @@ -98,14 +92,19 @@ public struct Features: Codable, Equatable {
*/
public var summarization: SummarizationOptions?

/**
Returns a five-level taxonomy of the content. The top three categories are returned.
Supported languages: Arabic, English, French, German, Italian, Japanese, Korean, Portuguese, Spanish.
*/
public var categories: CategoriesOptions?

/**
Returns tokens and sentences from the input text.
*/
public var syntax: SyntaxOptions?

// Map each property name to the key that shall be used for encoding/decoding.
private enum CodingKeys: String, CodingKey {
case categories = "categories"
case classifications = "classifications"
case concepts = "concepts"
case emotion = "emotion"
Expand All @@ -116,14 +115,13 @@ public struct Features: Codable, Equatable {
case semanticRoles = "semantic_roles"
case sentiment = "sentiment"
case summarization = "summarization"
case categories = "categories"
case syntax = "syntax"
}

/**
Initialize a `Features` with member variables.
- parameter categories: Returns a five-level taxonomy of the content. The top three categories are returned.
Supported languages: Arabic, English, French, German, Italian, Japanese, Korean, Portuguese, Spanish.
- parameter classifications: Returns text classifications for the content.
Supported languages: English only.
- parameter concepts: Returns high-level concepts in the content. For example, a research paper about deep
Expand Down Expand Up @@ -156,12 +154,13 @@ public struct Features: Codable, Equatable {
Supported languages: Arabic, English, French, German, Italian, Japanese, Korean, Portuguese, Russian, Spanish.
- parameter summarization: (Experimental) Returns a summary of content.
Supported languages: English only.
- parameter categories: Returns a five-level taxonomy of the content. The top three categories are returned.
Supported languages: Arabic, English, French, German, Italian, Japanese, Korean, Portuguese, Spanish.
- parameter syntax: Returns tokens and sentences from the input text.
- returns: An initialized `Features`.
*/
public init(
categories: CategoriesOptions? = nil,
classifications: ClassificationsOptions? = nil,
concepts: ConceptsOptions? = nil,
emotion: EmotionOptions? = nil,
Expand All @@ -172,10 +171,10 @@ public struct Features: Codable, Equatable {
semanticRoles: SemanticRolesOptions? = nil,
sentiment: SentimentOptions? = nil,
summarization: SummarizationOptions? = nil,
categories: CategoriesOptions? = nil,
syntax: SyntaxOptions? = nil
)
{
self.categories = categories
self.classifications = classifications
self.concepts = concepts
self.emotion = emotion
Expand All @@ -186,6 +185,7 @@ public struct Features: Codable, Equatable {
self.semanticRoles = semanticRoles
self.sentiment = sentiment
self.summarization = summarization
self.categories = categories
self.syntax = syntax
}

Expand Down

0 comments on commit 3172384

Please sign in to comment.