Class: Kotoshu::Language::LanguageIdentifier::DetectionResult
- Inherits:
-
Struct
- Object
- Struct
- Kotoshu::Language::LanguageIdentifier::DetectionResult
- Defined in:
- lib/kotoshu/language/identifier.rb
Overview
Value object for detection result.
Instance Attribute Summary collapse
-
#confidence ⇒ Float
readonly
Confidence score (0.0 to 1.0).
-
#label ⇒ String
readonly
Raw FastText label.
-
#language ⇒ String
readonly
ISO 639-1 language code.
Instance Method Summary collapse
Instance Attribute Details
#confidence ⇒ Float (readonly)
Confidence score (0.0 to 1.0)
80 81 82 |
# File 'lib/kotoshu/language/identifier.rb', line 80 def confidence @confidence end |
#label ⇒ String (readonly)
Raw FastText label
80 81 82 |
# File 'lib/kotoshu/language/identifier.rb', line 80 def label @label end |
#language ⇒ String (readonly)
ISO 639-1 language code
80 81 82 |
# File 'lib/kotoshu/language/identifier.rb', line 80 def language @language end |
Instance Method Details
#to_s ⇒ Object
81 82 83 |
# File 'lib/kotoshu/language/identifier.rb', line 81 def to_s "#{language} (#{(confidence * 100).round(1)}%)" end |