Skip to content

Commit

Permalink
feat(DiscoveryV1): Add new concepts property to NluEnrichmentFeatures…
Browse files Browse the repository at this point in the history
… model

concepts uses the new type NluEnrichmentConcepts
  • Loading branch information
Anthony Oliveri committed Dec 11, 2018
1 parent 631affc commit 80258db
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 1 deletion.
49 changes: 49 additions & 0 deletions Source/DiscoveryV1/Models/NluEnrichmentConcepts.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/**
* Copyright IBM Corporation 2018
*
* 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.
**/

import Foundation

/**
An object specifiying the concepts enrichment and related parameters.
*/
public struct NluEnrichmentConcepts: Codable, Equatable {

/**
The maximum number of concepts enrichments to extact from each instance of the specified field.
*/
public var limit: Int?

// Map each property name to the key that shall be used for encoding/decoding.
private enum CodingKeys: String, CodingKey {
case limit = "limit"
}

/**
Initialize a `NluEnrichmentConcepts` with member variables.
- parameter limit: The maximum number of concepts enrichments to extact from each instance of the specified
field.
- returns: An initialized `NluEnrichmentConcepts`.
*/
public init(
limit: Int? = nil
)
{
self.limit = limit
}

}
11 changes: 10 additions & 1 deletion Source/DiscoveryV1/Models/NluEnrichmentFeatures.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ public struct NluEnrichmentFeatures: Codable, Equatable {
*/
public var relations: NluEnrichmentRelations?

/**
An object specifiying the concepts enrichment and related parameters.
*/
public var concepts: NluEnrichmentConcepts?

// Map each property name to the key that shall be used for encoding/decoding.
private enum CodingKeys: String, CodingKey {
case keywords = "keywords"
Expand All @@ -63,6 +68,7 @@ public struct NluEnrichmentFeatures: Codable, Equatable {
case categories = "categories"
case semanticRoles = "semantic_roles"
case relations = "relations"
case concepts = "concepts"
}

/**
Expand All @@ -76,6 +82,7 @@ public struct NluEnrichmentFeatures: Codable, Equatable {
field.
- parameter semanticRoles: An object specifiying the semantic roles enrichment and related parameters.
- parameter relations: An object specifying the relations enrichment and related parameters.
- parameter concepts: An object specifiying the concepts enrichment and related parameters.
- returns: An initialized `NluEnrichmentFeatures`.
*/
Expand All @@ -86,7 +93,8 @@ public struct NluEnrichmentFeatures: Codable, Equatable {
emotion: NluEnrichmentEmotion? = nil,
categories: NluEnrichmentCategories? = nil,
semanticRoles: NluEnrichmentSemanticRoles? = nil,
relations: NluEnrichmentRelations? = nil
relations: NluEnrichmentRelations? = nil,
concepts: NluEnrichmentConcepts? = nil
)
{
self.keywords = keywords
Expand All @@ -96,6 +104,7 @@ public struct NluEnrichmentFeatures: Codable, Equatable {
self.categories = categories
self.semanticRoles = semanticRoles
self.relations = relations
self.concepts = concepts
}

}
2 changes: 2 additions & 0 deletions WatsonDeveloperCloud.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1725,6 +1725,7 @@
928204C62124BC200013315B /* LogQueryResponseResult.swift */,
928204C02124BC1E0013315B /* LogQueryResponseResultDocuments.swift */,
928204C12124BC1E0013315B /* LogQueryResponseResultDocumentsResult.swift */,
926FAD6321BB3B2D00033989 /* MemoryUsage.swift */,
928204C42124BC1F0013315B /* MetricAggregation.swift */,
928204BB2124BC1C0013315B /* MetricAggregationResult.swift */,
928204C22124BC1F0013315B /* MetricResponse.swift */,
Expand All @@ -1734,6 +1735,7 @@
683955002077E612009E1C8A /* Nested.swift */,
68AF8EC1206968CC00D552E3 /* NewTrainingQuery.swift */,
68AF8EFA206968CC00D552E3 /* NluEnrichmentCategories.swift */,
926FAD6121BB3B2C00033989 /* NluEnrichmentConcepts.swift */,
68AF8EB7206968CC00D552E3 /* NluEnrichmentEmotion.swift */,
68AF8EDE206968CC00D552E3 /* NluEnrichmentEntities.swift */,
68AF8EB8206968CC00D552E3 /* NluEnrichmentFeatures.swift */,
Expand Down

0 comments on commit 80258db

Please sign in to comment.