classifier 2.7.1 → 2.7.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/CHANGELOG.md +7 -0
- data/lib/classifier/lsi.rb +6 -1
- data/lib/classifier/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b98ea62d5d8726c4b65f03b4de99766e75482b29ce0e1877254b30cfa680a048
|
|
4
|
+
data.tar.gz: afcf755c52f1438a1a84e245561f2f13ae03fd9d959d1e7d4e92716e5606fbc6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 968dfdd51cb9b9f4cbb81ca2f81c894efbf390e60969dbb368807677c43586a2ab4e9ccfef415176757d672de5c72c86cbac75bab927a953a3c124f337591a77
|
|
7
|
+
data.tar.gz: 81bb882ce8b78e7ccafba5e34158747c8858777884098b76361637f27ecd6c164d034502e709ef690f1636428ea2542cd800a42a277fa684a4c223662e5124d9
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.7.2 - 2026-11-30
|
|
4
|
+
|
|
5
|
+
- Fix LSI and KNN JSON save/load so `min_word_length` is preserved.
|
|
6
|
+
Models trained with a non-default minimum no longer tokenize new
|
|
7
|
+
items with the config default after reload. JSON written before
|
|
8
|
+
this change still loads, and uses the current config default.
|
|
9
|
+
|
|
3
10
|
## 2.7.1 - 2026-11-30
|
|
4
11
|
|
|
5
12
|
- Fix `Bayes#add_category` so a second call for an existing category
|
data/lib/classifier/lsi.rb
CHANGED
|
@@ -517,6 +517,7 @@ module Classifier
|
|
|
517
517
|
version: 1,
|
|
518
518
|
type: 'lsi',
|
|
519
519
|
auto_rebuild: @auto_rebuild,
|
|
520
|
+
min_word_length: @min_word_length,
|
|
520
521
|
items: items_data
|
|
521
522
|
}
|
|
522
523
|
end
|
|
@@ -539,7 +540,10 @@ module Classifier
|
|
|
539
540
|
raise ArgumentError, "Invalid classifier type: #{data['type']}" unless data['type'] == 'lsi'
|
|
540
541
|
|
|
541
542
|
# Create instance with auto_rebuild disabled during loading
|
|
542
|
-
instance = new(
|
|
543
|
+
instance = new(
|
|
544
|
+
auto_rebuild: false,
|
|
545
|
+
min_word_length: data['min_word_length'] || Classifier.config.min_word_length
|
|
546
|
+
)
|
|
543
547
|
|
|
544
548
|
# Restore items (categories stay as strings, matching original storage)
|
|
545
549
|
data['items'].each do |item_key, item_data|
|
|
@@ -762,6 +766,7 @@ module Classifier
|
|
|
762
766
|
|
|
763
767
|
# Restore settings
|
|
764
768
|
@auto_rebuild = data['auto_rebuild']
|
|
769
|
+
@min_word_length = data['min_word_length'] || Classifier.config.min_word_length
|
|
765
770
|
@version += 1
|
|
766
771
|
@built_at_version = -1
|
|
767
772
|
@word_list = WordList.new
|
data/lib/classifier/version.rb
CHANGED