what_you_say 0.7.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1f31454520c1ef1729f787db804ce0f6f438e4bc9a6cd9f135ff1e5e105e6f51
4
- data.tar.gz: f981bfe1e8f126dce333ba475a95463324d2e68891e8596ec46a80f711ef7f72
3
+ metadata.gz: 580254e76b6e4e0fd78525f421c5c68f6c35d901a054ada79d4ae167968f407c
4
+ data.tar.gz: 2eae89fbf0f2cac8c71e48ea6c5ac0353e0547c0ee974de074e908b1db346500
5
5
  SHA512:
6
- metadata.gz: c58368e7503bbfd10fc86a9c3f5cec0ddf0f50fe947be1a205daee9a96be3c1fa51e228720584f0691a57ff4b42795cbf56de0745d9459d80bd2b786487e9a81
7
- data.tar.gz: ccebe1fc06612931ae29f7e1e2a7fe136a91b73ac4f1619728b852085a1cf8b5d3ba191ea9ec9866a66f27980be4b8c99f45bfb4a766856a848cfae130084be0
6
+ metadata.gz: ff22afc023054957cc7e32d9b8abcb90e67fb461696c2d63ac435232284fc67ce5fecc84bd9831a3550707b204489d190f45d263af8c0b2f42ce785c0fdb5d74
7
+ data.tar.gz: 667b40cfff18ecb04ef7e6c135c0b005130fe2d3f7925102ff95006a5f311304fa7edba3faaf0288788c31591d36952fd77c5fba5cd7440c5482b1ff4f9737cf
data/Cargo.toml CHANGED
@@ -5,3 +5,6 @@
5
5
  [workspace]
6
6
  members = ["ext/what_you_say"]
7
7
  resolver = "2"
8
+
9
+ [profile.release]
10
+ strip = true
data/README.md CHANGED
@@ -68,6 +68,30 @@ assert_equal("???", result.code)
68
68
  assert_equal("unknown", result.eng_name)
69
69
  ```
70
70
 
71
+ ### Detection with confidence scores
72
+
73
+ Use `detect_language_with_confidence` to get all candidate languages ranked by their detection confidence:
74
+
75
+ ```ruby
76
+ detector = WhatYouSay.new(allowlist: ["English", "French", "German", "Spanish"])
77
+ detector.detect_language_with_confidence("languages are awesome")
78
+ # => [[#<WhatYouSay::Lang code="eng" eng_name="English">, 0.9250120192490813],
79
+ # [#<WhatYouSay::Lang code="fra" eng_name="French">, 0.043595558302827526],
80
+ # [#<WhatYouSay::Lang code="deu" eng_name="German">, 0.020589166619996536],
81
+ # [#<WhatYouSay::Lang code="spa" eng_name="Spanish">, 0.01080325582809466]]
82
+ ```
83
+
84
+ This is useful when you need to apply confidence thresholds, handle ambiguous text, or consider alternative language candidates.
85
+
86
+ #### Interpreting the result
87
+
88
+ - Results are ordered from most to least likely.
89
+ - In this example:
90
+ - English is the most likely match (~92.5%)
91
+ - French, German, and Spanish are much less likely
92
+ - The scores represent relative confidence across the allowed languages.
93
+
94
+
71
95
  ## Development
72
96
 
73
97
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake compile test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -12,3 +12,4 @@ magnus = "0.8"
12
12
  [lib]
13
13
  name = "what_you_say"
14
14
  crate-type = ["cdylib"]
15
+
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class WhatYouSay
4
- VERSION = "0.7.0"
4
+ VERSION = "0.7.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: what_you_say
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen J. Torikian