Class: Zrip::DictTrainer
- Inherits:
-
Object
- Object
- Zrip::DictTrainer
- Defined in:
- lib/zrip/dict_trainer.rb
Overview
FastCOVER-based Zstandard dictionary trainer.
Class Method Summary collapse
-
._native_new(max_dict_size) ⇒ DictTrainer
Native constructor used by
.new. -
.new(max_dict_size) ⇒ DictTrainer
Create a dictionary trainer.
Instance Method Summary collapse
-
#add_sample(bytes) ⇒ nil
Add a training sample.
-
#max_dict_size ⇒ Integer
Configured maximum dictionary size.
-
#sample_count ⇒ Integer
Accepted sample count.
-
#total_bytes ⇒ Integer
Total bytes from accepted samples.
-
#train ⇒ String
Train and consume the trainer.
- #trained? ⇒ Boolean
Class Method Details
._native_new(max_dict_size) ⇒ DictTrainer
Native constructor used by .new.
36 37 38 39 40 |
# File 'lib/zrip/dict_trainer.rb', line 36 class DictTrainer def self.new(max_dict_size) _native_new(max_dict_size) end end |
.new(max_dict_size) ⇒ DictTrainer
Create a dictionary trainer.
36 37 38 39 40 |
# File 'lib/zrip/dict_trainer.rb', line 36 class DictTrainer def self.new(max_dict_size) _native_new(max_dict_size) end end |
Instance Method Details
#add_sample(bytes) ⇒ nil
Add a training sample. Samples shorter than 4 bytes are ignored.
36 37 38 39 40 |
# File 'lib/zrip/dict_trainer.rb', line 36 class DictTrainer def self.new(max_dict_size) _native_new(max_dict_size) end end |
#max_dict_size ⇒ Integer
Returns configured maximum dictionary size.
36 37 38 39 40 |
# File 'lib/zrip/dict_trainer.rb', line 36 class DictTrainer def self.new(max_dict_size) _native_new(max_dict_size) end end |
#sample_count ⇒ Integer
Returns accepted sample count.
36 37 38 39 40 |
# File 'lib/zrip/dict_trainer.rb', line 36 class DictTrainer def self.new(max_dict_size) _native_new(max_dict_size) end end |
#total_bytes ⇒ Integer
Returns total bytes from accepted samples.
36 37 38 39 40 |
# File 'lib/zrip/dict_trainer.rb', line 36 class DictTrainer def self.new(max_dict_size) _native_new(max_dict_size) end end |
#train ⇒ String
Train and consume the trainer.
36 37 38 39 40 |
# File 'lib/zrip/dict_trainer.rb', line 36 class DictTrainer def self.new(max_dict_size) _native_new(max_dict_size) end end |
#trained? ⇒ Boolean
36 37 38 39 40 |
# File 'lib/zrip/dict_trainer.rb', line 36 class DictTrainer def self.new(max_dict_size) _native_new(max_dict_size) end end |