Class: VK::CRi

Inherits:
Object
  • Object
show all
Defined in:
lib/valkey/objects.rb,
lib/valkey/objects.rb

Instance Method Summary collapse

Constructor Details

#initialize(k) ⇒ CRi

Returns a new instance of CRi.



251
252
253
254
# File 'lib/valkey/objects.rb', line 251

def initialize k
  @id = k
  @lsi = ClassifierReborn::LSI.new
end

Instance Method Details

#[](k) ⇒ Object



258
259
260
# File 'lib/valkey/objects.rb', line 258

def [] k
  @lsi.classify k
end

#learn(x, i) ⇒ Object



255
256
257
# File 'lib/valkey/objects.rb', line 255

def learn x, i
  @lsi.add_item x.to_s, i.to_sym
end

#search(x, *n) ⇒ Object



261
262
263
# File 'lib/valkey/objects.rb', line 261

def search x, *n
  @lsi.search(x, n[0])
end