apiverve_spellchecker 1.2.4 → 1.2.5
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 +4 -4
- data/README.md +24 -4
- data/lib/apiverve_spellchecker/client.rb +2 -2
- data/lib/apiverve_spellchecker.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 295e400c7aba5b051fe10e9e9e9aaae5dcd1d4ba8131d50cb1e2d3d5bf8a7939
|
|
4
|
+
data.tar.gz: dd25228e1a1d39e9751bf82c9f2876422e961707670d6aac60c0908d3fffa4da
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a9f34d6ad2006e76e8bfd74797557264914a5925f52394046c54aadbf8d3128de1c72b888be4f9eaefe4378eb2f54c33aa1e26765b090f003fa2ee3100729c9d
|
|
7
|
+
data.tar.gz: dfa1d88d630f82f81e98efd28473746c3df268344b47c6b1677aca125240eb6da7aaaef71feb70fb5f8074056ea20d1ee628ecd19a051281672ad0b8c0fe86f6
|
data/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Spell Checker API - Ruby Gem
|
|
2
2
|
|
|
3
|
-
Spell Checker flags misspelled words in submitted English text and generates correction suggestions. It counts total spelling errors
|
|
3
|
+
Spell Checker flags misspelled words in submitted English text and generates correction suggestions. It counts total spelling errors, lists possible replacements for each mistaken word, and can return the text with the top suggestions applied, plus on paid plans the character offsets of every misspelling.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -35,7 +35,11 @@ require 'apiverve_spellchecker'
|
|
|
35
35
|
client = APIVerve::Spellchecker::Client.new(api_key: "YOUR_API_KEY")
|
|
36
36
|
|
|
37
37
|
# Make a request
|
|
38
|
-
response = client.execute({
|
|
38
|
+
response = client.execute({
|
|
39
|
+
text: "I neeed to call my friend on telephine today!",
|
|
40
|
+
autocorrect: true,
|
|
41
|
+
offsets: true
|
|
42
|
+
})
|
|
39
43
|
|
|
40
44
|
# Print the response
|
|
41
45
|
puts response
|
|
@@ -46,7 +50,7 @@ puts response
|
|
|
46
50
|
|
|
47
51
|
```ruby
|
|
48
52
|
begin
|
|
49
|
-
response = client.execute({ text: "I neeed to call my friend on telephine today!" })
|
|
53
|
+
response = client.execute({ text: "I neeed to call my friend on telephine today!", autocorrect: true, offsets: true })
|
|
50
54
|
puts response["data"]
|
|
51
55
|
rescue APIVerve::Spellchecker::ValidationError => e
|
|
52
56
|
puts "Validation error: #{e.errors.join(', ')}"
|
|
@@ -75,6 +79,7 @@ client = APIVerve::Spellchecker::Client.new(
|
|
|
75
79
|
"data": {
|
|
76
80
|
"spellPass": false,
|
|
77
81
|
"mispellingsFound": 2,
|
|
82
|
+
"totalOccurrences": 2,
|
|
78
83
|
"corrections": [
|
|
79
84
|
{
|
|
80
85
|
"word": "neeed",
|
|
@@ -84,6 +89,13 @@ client = APIVerve::Spellchecker::Client.new(
|
|
|
84
89
|
"needy",
|
|
85
90
|
"Neel",
|
|
86
91
|
"needs"
|
|
92
|
+
],
|
|
93
|
+
"occurrences": 1,
|
|
94
|
+
"offsets": [
|
|
95
|
+
{
|
|
96
|
+
"start": 2,
|
|
97
|
+
"end": 7
|
|
98
|
+
}
|
|
87
99
|
]
|
|
88
100
|
},
|
|
89
101
|
{
|
|
@@ -94,9 +106,17 @@ client = APIVerve::Spellchecker::Client.new(
|
|
|
94
106
|
"telephoner",
|
|
95
107
|
"telephones",
|
|
96
108
|
"telephony"
|
|
109
|
+
],
|
|
110
|
+
"occurrences": 1,
|
|
111
|
+
"offsets": [
|
|
112
|
+
{
|
|
113
|
+
"start": 29,
|
|
114
|
+
"end": 38
|
|
115
|
+
}
|
|
97
116
|
]
|
|
98
117
|
}
|
|
99
|
-
]
|
|
118
|
+
],
|
|
119
|
+
"correctedText": "I needed to call my friend on telephone today!"
|
|
100
120
|
}
|
|
101
121
|
}
|
|
102
122
|
```
|
|
@@ -10,7 +10,7 @@ module APIVerve
|
|
|
10
10
|
#
|
|
11
11
|
# @example Basic usage
|
|
12
12
|
# client = APIVerve::Spellchecker::Client.new(api_key: "your_api_key")
|
|
13
|
-
# response = client.execute({ text: "I neeed to call my friend on telephine today!" })
|
|
13
|
+
# response = client.execute({ text: "I neeed to call my friend on telephine today!", autocorrect: true, offsets: true })
|
|
14
14
|
# puts response
|
|
15
15
|
#
|
|
16
16
|
# @see https://apiverve.com/marketplace/spellchecker?utm_source=ruby&utm_medium=referral&utm_content=readme
|
|
@@ -19,7 +19,7 @@ module APIVerve
|
|
|
19
19
|
DEFAULT_TIMEOUT = 30
|
|
20
20
|
|
|
21
21
|
# Validation rules for parameters
|
|
22
|
-
VALIDATION_RULES = { 'text' => { type: 'string', required: true, max_length: 50000 } }
|
|
22
|
+
VALIDATION_RULES = { 'text' => { type: 'string', required: true, max_length: 50000 }, 'autocorrect' => { type: 'boolean', required: false }, 'offsets' => { type: 'boolean', required: false } }
|
|
23
23
|
|
|
24
24
|
# Format validation patterns
|
|
25
25
|
FORMAT_PATTERNS = {
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: apiverve_spellchecker
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- APIVerve
|
|
@@ -58,8 +58,9 @@ dependencies:
|
|
|
58
58
|
- !ruby/object:Gem::Version
|
|
59
59
|
version: '2.0'
|
|
60
60
|
description: Spell Checker flags misspelled words in submitted English text and generates
|
|
61
|
-
correction suggestions. It counts total spelling errors
|
|
62
|
-
for each mistaken word
|
|
61
|
+
correction suggestions. It counts total spelling errors, lists possible replacements
|
|
62
|
+
for each mistaken word, and can return the text with the top suggestions applied,
|
|
63
|
+
plus on paid plans the character offsets of every misspelling.
|
|
63
64
|
email:
|
|
64
65
|
- hello@apiverve.com
|
|
65
66
|
executables: []
|