spellkit 0.1.1 → 0.1.2
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 +26 -3
- data/ext/spellkit/Cargo.toml +1 -1
- data/lib/spellkit/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e36701637cedd91531b05d0b18680e57d26b9aae7e117d6a179f27d30a61e444
|
|
4
|
+
data.tar.gz: 560114d91574153e6b618c509a705bbcd82969e4a437aee777fa2ee7f10babcc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6cc82708564b26e943b4bc394ec41c13aa59c3ff7388027d113001cc8f8f8e83f219795b5547ab2ed318c9ab89733efbfbf3b937cdcf75d70a51836d5c2e4283
|
|
7
|
+
data.tar.gz: a6903fb208c64dc53bd07ee2b183e4a5bfe552d038ee87129e6afe3f32b14197c0d6546139abeada777ff98db3ee2466c86dd158561bf8d9d8beedacc6b7b335
|
data/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<img src="/docs/assets/spellkit-wide.png" alt="spellkit" height="160px">
|
|
2
2
|
|
|
3
|
-
Fast, safe typo correction for search-term extraction
|
|
3
|
+
Fast, safe typo correction for search-term extraction. A Ruby gem with a native Rust implementation of the SymSpell algorithm.
|
|
4
4
|
|
|
5
5
|
SpellKit provides:
|
|
6
6
|
- **Fast correction** using SymSpell with configurable edit distance (1 or 2)
|
|
@@ -9,6 +9,8 @@ SpellKit provides:
|
|
|
9
9
|
- **Sub-millisecond latency** - p95 < 2µs on small dictionaries
|
|
10
10
|
- **Thread-safe** - built with Rust's Arc<RwLock> for safe concurrent access
|
|
11
11
|
|
|
12
|
+
**Why a custom implementation?** Existing Rust SymSpell crates require lowercase dictionary entries, but SpellKit preserves canonical forms (NASA stays NASA, iPhone stays iPhone). We also needed domain-specific guards, hot-reload, and Aspell-style skip patterns - features not available in existing implementations.
|
|
13
|
+
|
|
12
14
|
## Why SpellKit?
|
|
13
15
|
|
|
14
16
|
### No Runtime Dependencies
|
|
@@ -542,7 +544,7 @@ end
|
|
|
542
544
|
|
|
543
545
|
## Performance
|
|
544
546
|
|
|
545
|
-
### SpellKit Standalone (
|
|
547
|
+
### SpellKit Standalone (M4 Max MacBook Pro, Ruby 3.3.0, 80k dictionary)
|
|
546
548
|
|
|
547
549
|
**Single Word Suggestions:**
|
|
548
550
|
- 3,345 i/s (298.96 μs/i) with max: 1 suggestion
|
|
@@ -572,6 +574,27 @@ end
|
|
|
572
574
|
3. **High Throughput**: Over 16k operations per second with 80k word dictionary
|
|
573
575
|
4. **Scales Well**: Minimal performance difference between 1 vs 10 suggestions
|
|
574
576
|
|
|
577
|
+
### Comparison with Aspell
|
|
578
|
+
|
|
579
|
+
SpellKit vs Aspell (M4 Max MacBook Pro, Ruby 3.3.0, 80k dictionary):
|
|
580
|
+
|
|
581
|
+
**Suggestion Performance (13 misspelled words):**
|
|
582
|
+
- SpellKit: 3,162 i/s (316μs per batch)
|
|
583
|
+
- Aspell: 433 i/s (2.31ms per batch)
|
|
584
|
+
- **SpellKit is 7.3x faster**
|
|
585
|
+
|
|
586
|
+
**Spell Checking (correct? on 26 words):**
|
|
587
|
+
- SpellKit: 263,279 i/s (3.8μs per batch)
|
|
588
|
+
- Aspell: 72,099 i/s (13.9μs per batch)
|
|
589
|
+
- **SpellKit is 3.65x faster**
|
|
590
|
+
|
|
591
|
+
**Latency Distribution (10,000 single-word suggestions):**
|
|
592
|
+
- SpellKit: p50=63μs, p95=69μs, p99=98μs
|
|
593
|
+
- Aspell: p50=105μs, p95=121μs, p99=182μs
|
|
594
|
+
- **SpellKit is 1.7x faster at p50, 1.75x faster at p95**
|
|
595
|
+
|
|
596
|
+
Both libraries provide high-quality spell checking, but SpellKit's SymSpell algorithm (O(1) lookup) offers significant performance advantages over Aspell's statistical approach, especially for high-throughput applications.
|
|
597
|
+
|
|
575
598
|
## Benchmarks
|
|
576
599
|
|
|
577
600
|
SpellKit includes comprehensive benchmarks to measure performance and compare with other spell checkers.
|
|
@@ -671,4 +694,4 @@ Bug reports and pull requests are welcome at https://github.com/scientist-labs/s
|
|
|
671
694
|
|
|
672
695
|
## License
|
|
673
696
|
|
|
674
|
-
MIT License - see [LICENSE](LICENSE) file for details.
|
|
697
|
+
MIT License - see [LICENSE](LICENSE.txt) file for details.
|
data/ext/spellkit/Cargo.toml
CHANGED
data/lib/spellkit/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: spellkit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Chris Petersen
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-09-
|
|
11
|
+
date: 2025-09-28 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rb_sys
|
|
@@ -150,8 +150,8 @@ dependencies:
|
|
|
150
150
|
- - ">="
|
|
151
151
|
- !ruby/object:Gem::Version
|
|
152
152
|
version: '0'
|
|
153
|
-
description: A Ruby gem
|
|
154
|
-
with domain-specific term protection
|
|
153
|
+
description: A Ruby gem with a native Rust implementation of the SymSpell algorithm
|
|
154
|
+
for fast typo correction with domain-specific term protection
|
|
155
155
|
email:
|
|
156
156
|
- chris@petersen.io
|
|
157
157
|
executables: []
|
|
@@ -191,7 +191,6 @@ licenses:
|
|
|
191
191
|
metadata:
|
|
192
192
|
homepage_uri: https://github.com/scientist-labs/spellkit
|
|
193
193
|
source_code_uri: https://github.com/scientist-labs/spellkit
|
|
194
|
-
changelog_uri: https://github.com/scientist-labs/spellkit/blob/main/CHANGELOG.md
|
|
195
194
|
post_install_message:
|
|
196
195
|
rdoc_options: []
|
|
197
196
|
require_paths:
|
|
@@ -206,7 +205,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
206
205
|
- - ">="
|
|
207
206
|
- !ruby/object:Gem::Version
|
|
208
207
|
version: '0'
|
|
209
|
-
requirements:
|
|
208
|
+
requirements:
|
|
209
|
+
- Rust >= 1.85
|
|
210
210
|
rubygems_version: 3.5.3
|
|
211
211
|
signing_key:
|
|
212
212
|
specification_version: 4
|