Skip to content

Commit 80258db

Browse files
author
Anthony Oliveri
committed
feat(DiscoveryV1): Add new concepts property to NluEnrichmentFeatures model
concepts uses the new type NluEnrichmentConcepts
1 parent 631affc commit 80258db

File tree

3 files changed

+61
-1
lines changed

3 files changed

+61
-1
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/**
2+
* Copyright IBM Corporation 2018
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
**/
16+
17+
import Foundation
18+
19+
/**
20+
An object specifiying the concepts enrichment and related parameters.
21+
*/
22+
public struct NluEnrichmentConcepts: Codable, Equatable {
23+
24+
/**
25+
The maximum number of concepts enrichments to extact from each instance of the specified field.
26+
*/
27+
public var limit: Int?
28+
29+
// Map each property name to the key that shall be used for encoding/decoding.
30+
private enum CodingKeys: String, CodingKey {
31+
case limit = "limit"
32+
}
33+
34+
/**
35+
Initialize a `NluEnrichmentConcepts` with member variables.
36+
37+
- parameter limit: The maximum number of concepts enrichments to extact from each instance of the specified
38+
field.
39+
40+
- returns: An initialized `NluEnrichmentConcepts`.
41+
*/
42+
public init(
43+
limit: Int? = nil
44+
)
45+
{
46+
self.limit = limit
47+
}
48+
49+
}

Source/DiscoveryV1/Models/NluEnrichmentFeatures.swift

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ public struct NluEnrichmentFeatures: Codable, Equatable {
5454
*/
5555
public var relations: NluEnrichmentRelations?
5656

57+
/**
58+
An object specifiying the concepts enrichment and related parameters.
59+
*/
60+
public var concepts: NluEnrichmentConcepts?
61+
5762
// Map each property name to the key that shall be used for encoding/decoding.
5863
private enum CodingKeys: String, CodingKey {
5964
case keywords = "keywords"
@@ -63,6 +68,7 @@ public struct NluEnrichmentFeatures: Codable, Equatable {
6368
case categories = "categories"
6469
case semanticRoles = "semantic_roles"
6570
case relations = "relations"
71+
case concepts = "concepts"
6672
}
6773

6874
/**
@@ -76,6 +82,7 @@ public struct NluEnrichmentFeatures: Codable, Equatable {
7682
field.
7783
- parameter semanticRoles: An object specifiying the semantic roles enrichment and related parameters.
7884
- parameter relations: An object specifying the relations enrichment and related parameters.
85+
- parameter concepts: An object specifiying the concepts enrichment and related parameters.
7986

8087
- returns: An initialized `NluEnrichmentFeatures`.
8188
*/
@@ -86,7 +93,8 @@ public struct NluEnrichmentFeatures: Codable, Equatable {
8693
emotion: NluEnrichmentEmotion? = nil,
8794
categories: NluEnrichmentCategories? = nil,
8895
semanticRoles: NluEnrichmentSemanticRoles? = nil,
89-
relations: NluEnrichmentRelations? = nil
96+
relations: NluEnrichmentRelations? = nil,
97+
concepts: NluEnrichmentConcepts? = nil
9098
)
9199
{
92100
self.keywords = keywords
@@ -96,6 +104,7 @@ public struct NluEnrichmentFeatures: Codable, Equatable {
96104
self.categories = categories
97105
self.semanticRoles = semanticRoles
98106
self.relations = relations
107+
self.concepts = concepts
99108
}
100109

101110
}

WatsonDeveloperCloud.xcodeproj/project.pbxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1725,6 +1725,7 @@
17251725
928204C62124BC200013315B /* LogQueryResponseResult.swift */,
17261726
928204C02124BC1E0013315B /* LogQueryResponseResultDocuments.swift */,
17271727
928204C12124BC1E0013315B /* LogQueryResponseResultDocumentsResult.swift */,
1728+
926FAD6321BB3B2D00033989 /* MemoryUsage.swift */,
17281729
928204C42124BC1F0013315B /* MetricAggregation.swift */,
17291730
928204BB2124BC1C0013315B /* MetricAggregationResult.swift */,
17301731
928204C22124BC1F0013315B /* MetricResponse.swift */,
@@ -1734,6 +1735,7 @@
17341735
683955002077E612009E1C8A /* Nested.swift */,
17351736
68AF8EC1206968CC00D552E3 /* NewTrainingQuery.swift */,
17361737
68AF8EFA206968CC00D552E3 /* NluEnrichmentCategories.swift */,
1738+
926FAD6121BB3B2C00033989 /* NluEnrichmentConcepts.swift */,
17371739
68AF8EB7206968CC00D552E3 /* NluEnrichmentEmotion.swift */,
17381740
68AF8EDE206968CC00D552E3 /* NluEnrichmentEntities.swift */,
17391741
68AF8EB8206968CC00D552E3 /* NluEnrichmentFeatures.swift */,

0 commit comments

Comments
 (0)