Skip to content

Commit 8057925

Browse files
authored
chore(Predictions) : Add doc comments (#1239)
* chore(Predictions) : Added doc comments * Add more doc comments in Predictions category * Update doc comments as per review comments * Address review comments
1 parent 9ed60c7 commit 8057925

36 files changed

+111
-7
lines changed

Amplify/Categories/Predictions/Models/AgeRange.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
import Foundation
99

10+
/// Age range of an entity(faces/celebrities) detected
11+
/// as a result of identify() API
1012
public struct AgeRange {
1113
public let low: Int
1214
public let high: Int

Amplify/Categories/Predictions/Models/Attribute.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import Foundation
99

10+
/// Attribute of an entity identified as a result of identify() API
1011
public struct Attribute {
1112
public let name: String
1213
public let value: Bool
@@ -19,6 +20,8 @@ public struct Attribute {
1920
}
2021
}
2122

23+
/// Gender of an entity(face/celebrity) identified with
24+
/// associated confidence value
2225
public struct GenderAttribute {
2326
public var gender: GenderType
2427
public var confidence: Double

Amplify/Categories/Predictions/Models/BoundedKeyValue.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77

88
import CoreGraphics
99

10+
/// Describes the data extracted as key-value pair in
11+
/// an image/document resulting from identify() API
12+
/// e.g The text "Name: John Doe" present in an image/document
1013
public struct BoundedKeyValue {
1114
public let key: String
1215
public let value: String

Amplify/Categories/Predictions/Models/Celebrity.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
import Foundation
99
import CoreGraphics
1010

11+
/// Describes a celebrity identified in an image
12+
/// with information about its location(bounding box) and
13+
/// facial features(landmarks)
1114
public struct Celebrity {
1215
public let metadata: CelebrityMetadata
1316
public let boundingBox: CGRect
@@ -20,6 +23,7 @@ public struct Celebrity {
2023
}
2124
}
2225

26+
/// Celebrity metadata identified as a result of identify() API
2327
public struct CelebrityMetadata {
2428
public let name: String
2529
public let identifier: String

Amplify/Categories/Predictions/Models/Emotion.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
// SPDX-License-Identifier: Apache-2.0
66
//
77

8+
/// Emotion identified in an entity(faces/celebrities)
9+
/// as a result of identify() API with associated `EmotionType`
10+
/// and confidence value
811
public struct Emotion {
912
public let emotion: EmotionType
1013
public let confidence: Double

Amplify/Categories/Predictions/Models/EmotionType.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
// SPDX-License-Identifier: Apache-2.0
66
//
77

8+
/// Different emotion types returned as a result of
9+
/// identify() API call
810
public enum EmotionType {
911
case angry
1012
case calm

Amplify/Categories/Predictions/Models/Entity.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77

88
import CoreGraphics
99

10-
/// Struct that holds the result of an entity detected from an image per the Identify method
10+
/// Result returned as part of identify() API call with
11+
/// `IdentifyAction.detectEntities` type parameter
1112
public struct Entity {
1213
public let boundingBox: CGRect
1314
public let landmarks: [Landmark]

Amplify/Categories/Predictions/Models/EntityDetectionResult.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
// SPDX-License-Identifier: Apache-2.0
66
//
77

8-
/// Struct that holds the entity detection result for a string of text for the Predictions category
8+
/// Describes the result of interpret() API when the analyzed text
9+
/// contains a person/place
910
public struct EntityDetectionResult {
1011
public let type: EntityType
1112
public let targetText: String

Amplify/Categories/Predictions/Models/EntityMatch.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
import CoreGraphics
99

10-
/// Struct that holds the result for an entity matched from an entity collection
11-
/// created on Rekogniton and detected from Predictions Identify methods.
10+
/// Describes the result for an entity matched in an entity collection
11+
/// created on AWS Rekogniton and detected from identify() API call
1212
public struct EntityMatch {
1313
public let boundingBox: CGRect
1414
public let metadata: EntityMatchMetadata

Amplify/Categories/Predictions/Models/EntityType.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
// SPDX-License-Identifier: Apache-2.0
66
//
77

8+
/// Different entity types detected in a text as a result of
9+
/// interpret() API
810
public enum EntityType: String {
911
case commercialItem
1012
case date

0 commit comments

Comments
 (0)