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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 535c466808c3cc2c5536ee61ce83896ba284742062eb23fbf70c215e4b433576
4
- data.tar.gz: c95d1f4aa2a8410af2f98a02e880717e190749261987dd0a86cacdfad420bacb
3
+ metadata.gz: b98ea62d5d8726c4b65f03b4de99766e75482b29ce0e1877254b30cfa680a048
4
+ data.tar.gz: afcf755c52f1438a1a84e245561f2f13ae03fd9d959d1e7d4e92716e5606fbc6
5
5
  SHA512:
6
- metadata.gz: edc391c811d357b3416642fb0be8354147b169a90a73eb6569f4d9aefdb794fe873d99f9058fe50c34982bfd3d96b5660c2fd5fa0871d5914ddefd195fa33cf2
7
- data.tar.gz: 826c74d22ea89a759b54b3f99a3ab73d574f752d9d55249212d217f6cafa9ae0240764f388cbdd4975e75f55dc2b0ec1758f8eb9a0a9d0e7578e0f57e3fb69b2
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
@@ -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(auto_rebuild: false)
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
@@ -1,3 +1,3 @@
1
1
  module Classifier
2
- VERSION = '2.7.1'.freeze
2
+ VERSION = '2.7.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: classifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.1
4
+ version: 2.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lucas Carlson