Class: VK::CRi
- Inherits:
-
Object
- Object
- VK::CRi
- Defined in:
- lib/valkey/objects.rb,
lib/valkey/objects.rb
Instance Method Summary collapse
- #[](k) ⇒ Object
-
#initialize(k) ⇒ CRi
constructor
A new instance of CRi.
- #learn(x, i) ⇒ Object
- #search(x, *n) ⇒ Object
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 |