Class: Classify3::Rust

Inherits:
FFI::AutoPointer
  • Object
show all
Defined in:
lib/classify3/bayes.rb

Defined Under Namespace

Modules: Binding

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.release(ptr) ⇒ Object



21
22
23
# File 'lib/classify3/bayes.rb', line 21

def self.release(ptr)
  Binding.free(ptr)
end

Instance Method Details

#add(doc, label) ⇒ Object



25
26
27
# File 'lib/classify3/bayes.rb', line 25

def add(doc, label)
  Binding.add(self, doc, label)
end

#classify(str) ⇒ Object



33
34
35
# File 'lib/classify3/bayes.rb', line 33

def classify(str)
  Binding.classify(self, str)
end

#trainObject



29
30
31
# File 'lib/classify3/bayes.rb', line 29

def train
  Binding.train(self)
end