Skip to content

Commit

Permalink
Update undocumented code (watson-developer-cloud#357)
Browse files Browse the repository at this point in the history
* Properly updated comment for the RelatedMentions model in Relationship Extraction

* Update comment for SynthesisVoice.US_Michael

* Fix Jazzy comments for Document Conversion, Alchemy Language, and Alchemy Data News

* Update AlchemyLanguage Entity.swift init comment
  • Loading branch information
Hsaylor authored and glennrfisher committed Jun 29, 2016
1 parent 611df41 commit bf03d20
Show file tree
Hide file tree
Showing 13 changed files with 68 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Source/AlchemyDataNewsV1/Models/DocumentSource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public struct DocumentSource: JSONDecodable {
/** see **DocumentEnriched** */
public let enriched: DocumentEnriched?

// used internally to initialize a DocumentSource object
/// used internally to initialize a DocumentSource object
public init(json: JSON) throws {
enriched = try? json.decode("enriched", type: DocumentEnriched.self)
}
Expand Down
2 changes: 1 addition & 1 deletion Source/AlchemyDataNewsV1/Models/Entity.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public struct Entity: JSONDecodable {
/** Classification */
public let type: String?

// Used internally to initialize an Entity object
/// Used internally to initialize an Entity object
public init(json: JSON) throws {
if let countString = try? json.string("count") {
count = Int(countString)
Expand Down
1 change: 1 addition & 0 deletions Source/AlchemyDataNewsV1/Models/NewsResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public struct NewsResponse: JSONDecodable {
/** see **NewsResult** */
public let result: NewsResult?

/// Used internally to initialize a NewsResponse object
public init(json: JSON) throws {
totalTransactions = try Int(json.string("totalTransactions"))!
result = try? json.decode("result", type: NewsResult.self)
Expand Down
2 changes: 1 addition & 1 deletion Source/AlchemyLanguageV1/AlchemyLanguage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class AlchemyLanguage {
private let errorDomain = "com.watsonplatform.alchemyLanguage"
private let userAgent = buildUserAgent("watson-apis-ios-sdk/0.4.0 AlchemyLanguageV1")

let unreservedCharacters = NSCharacterSet(charactersInString: "abcdefghijklmnopqrstuvwxyz" +
private let unreservedCharacters = NSCharacterSet(charactersInString: "abcdefghijklmnopqrstuvwxyz" +
"ABCDEFGHIJKLMNOPQRSTUVWXYZ" +
"1234567890-._~")

Expand Down
9 changes: 9 additions & 0 deletions Source/AlchemyLanguageV1/Models/DocumentEmotion.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,22 @@
import Foundation
import Freddy

/** Response object for **Emotions** related requests */
public struct DocumentEmotion: JSONDecodable {

/// content URL
public let url: String?

/// total number of transactions made by the request
public let totalTransactions: Int?

/// language of the analyzed document
public let language: String?

/// see **Emotions**
public let docEmotions: Emotions?

/// used internally to initialize a DocumentEmotion object
public init(json: JSON) throws {
url = try? json.string("url")
if let totalTransactionsString = try? json.string("totalTransactions") {
Expand Down
2 changes: 1 addition & 1 deletion Source/AlchemyLanguageV1/Models/Entity.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public struct Entity: JSONDecodable {
/** Classification */
public let type: String?

// Used internally to initialize an Entity object
/// Used internally to initialize an Entity object
public init(json: JSON) throws {
if let countString = try? json.string("count") {
count = Int(countString)
Expand Down
4 changes: 2 additions & 2 deletions Source/AlchemyLanguageV1/Models/Language.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ public struct Language: JSONDecodable {
/** the URL information was requestd for */
public let url: String?

//** link to Ethnologue containing information on detected language */
/** link to Ethnologue containing information on detected language */
public let ethnologue: String?

//** ISO-639-1 code for the detected language */
/** ISO-639-1 code for the detected language */
public let iso6391: String?

/** ISO-639-2 code for the detected language */
Expand Down
2 changes: 2 additions & 0 deletions Source/AlchemyLanguageV1/Models/QueryParam.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,7 @@ import Foundation
Enum for determining if a query parameter should be included in the request
*/
public enum QueryParam: Int {

/// Constants for if a query parameter should be included in the request
case Excluded = 0, Included
}
34 changes: 34 additions & 0 deletions Source/AlchemyLanguageV1/Models/SAORelation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,17 @@ import Freddy
*/

public struct SAORelation: JSONDecodable {

/// see Action
public let action: Action?

/// an extracted Sentence
public let sentence: String?

/// see Subject
public let subject: Subject?

/// see RelationObject
public let object: RelationObject?

/// Used internally to initialize a SAORelation object
Expand All @@ -45,8 +53,14 @@ public struct SAORelation: JSONDecodable {
An action as defined by the AlchemyLanguage service
*/
public struct Action: JSONDecodable {

/// text the action was extracted from
public let text: String?

/// the base or dictionary form of the word
public let lemmatized: String?

/// see Verb
public let verb: Verb?

/// Used internally to initialize an Action object
Expand All @@ -60,8 +74,14 @@ public struct Action: JSONDecodable {
A verb as defined by the AlchemyLanguage service
*/
public struct Verb: JSONDecodable {

/// text the verb was extracted from
public let text: String?

/// the tense of the verb
public let tense: String?

/// was the verb negated
public let negated: Int?

/// Used internally to initalize a Verb object
Expand All @@ -81,8 +101,14 @@ public struct Action: JSONDecodable {
A subjet extracted by the AlchemyLanguage service
*/
public struct Subject: JSONDecodable {

/// text the subject was extracted from
public let text: String?

/// see **Sentiment**
public let sentiment: Sentiment?

/// see **Entity**
public let entity: Entity?

/// Used internally to initialize a Subject object
Expand All @@ -97,9 +123,17 @@ public struct Subject: JSONDecodable {
**Sentiment** related to the Subject-Action-Object extraction
*/
public struct RelationObject: JSONDecodable {

/// text the relation object was extracted from
public let text: String?

/// see **Sentiment**
public let sentiment: Sentiment?

/// see **Sentiment**
public let sentimentFromSubject: Sentiment?

/// see **Entity**
public let entity: Entity?

/// Used internally to initialize a RelationObject object
Expand Down
6 changes: 6 additions & 0 deletions Source/DocumentConversionV1/DocumentConversion.swift
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,13 @@ public class DocumentConversion {
Enum for supported return types from the DocumentConversion service
*/
public enum ReturnType: String {

/// Constant for AnswerUnits
case AnswerUnits = "ANSWER_UNITS"

/// Constant for HTML
case HTML = "NORMALIZED_HTML"

/// Constant for Text
case Text = "NORMALIZED_TEXT"
}
8 changes: 8 additions & 0 deletions Source/DocumentConversionV1/Models/FileType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,16 @@ import Foundation
Enum for supported file types
*/
public enum FileType: String {

/// Constant for HTML file types
case HTML = "text/html"

/// Constant for XML file types
case XML = "text/xhtml+xml"

/// Constant for PDF file types
case PDF = "application/pdf"

/// Constant for MicrosoftWord documents
case MSWord = "application/msword"
}
2 changes: 1 addition & 1 deletion Source/RelationshipExtractionV1Beta/Models/Relations.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public struct RelationEntityArgument: JSONDecodable {
}
}

/* The mentions that refer to this specific relation. */
/** The mentions that refer to this specific relation. */
public struct RelatedMentions: JSONDecodable {

/// The alphanumeric identifier of the relation mention.
Expand Down
2 changes: 1 addition & 1 deletion Source/TextToSpeechV1/Models/SynthesisVoice.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public enum SynthesisVoice {
/// English (US dialect) with a female voice (`en-US_LisaVoice`).
case US_Lisa

// English (US dialect) with a male voice (`en-US_MichaelVoice`).
/// English (US dialect) with a male voice (`en-US_MichaelVoice`).
case US_Michael

/// Spanish (Castillian dialect) with a male voice (`es-ES_EnriqueVoice`).
Expand Down

0 comments on commit bf03d20

Please sign in to comment.