All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.aws.sdk.kotlin.services.comprehend.model.DominantLanguage.kt Maven / Gradle / Ivy

// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.comprehend.model



/**
 * Returns the code for the dominant language in the input text and the level of confidence that Amazon Comprehend has in the accuracy of the detection.
 */
public class DominantLanguage private constructor(builder: Builder) {
    /**
     * The RFC 5646 language code for the dominant language. For more information about RFC 5646, see [Tags for Identifying Languages](https://tools.ietf.org/html/rfc5646) on the *IETF Tools* web site.
     */
    public val languageCode: kotlin.String? = builder.languageCode
    /**
     * The level of confidence that Amazon Comprehend has in the accuracy of the detection.
     */
    public val score: kotlin.Float? = builder.score

    public companion object {
        public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.comprehend.model.DominantLanguage = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("DominantLanguage(")
        append("languageCode=$languageCode,")
        append("score=$score")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = languageCode?.hashCode() ?: 0
        result = 31 * result + (score?.hashCode() ?: 0)
        return result
    }

    override fun equals(other: kotlin.Any?): kotlin.Boolean {
        if (this === other) return true
        if (other == null || this::class != other::class) return false

        other as DominantLanguage

        if (languageCode != other.languageCode) return false
        if (score != other.score) return false

        return true
    }

    public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.comprehend.model.DominantLanguage = Builder(this).apply(block).build()

    public class Builder {
        /**
         * The RFC 5646 language code for the dominant language. For more information about RFC 5646, see [Tags for Identifying Languages](https://tools.ietf.org/html/rfc5646) on the *IETF Tools* web site.
         */
        public var languageCode: kotlin.String? = null
        /**
         * The level of confidence that Amazon Comprehend has in the accuracy of the detection.
         */
        public var score: kotlin.Float? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.comprehend.model.DominantLanguage) : this() {
            this.languageCode = x.languageCode
            this.score = x.score
        }

        @PublishedApi
        internal fun build(): aws.sdk.kotlin.services.comprehend.model.DominantLanguage = DominantLanguage(this)
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy