Class: VectorEmbed::Maker::Phrase

Inherits:
VectorEmbed::Maker show all
Defined in:
lib/vector_embed/maker/phrase.rb

Instance Attribute Summary

Attributes inherited from VectorEmbed::Maker

#cardinality, #k, #parent

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from VectorEmbed::Maker

#initialize, pick

Constructor Details

This class inherits a constructor from VectorEmbed::Maker

Class Method Details

.want?(v, parent) ⇒ Boolean

Returns:



7
8
9
# File 'lib/vector_embed/maker/phrase.rb', line 7

def want?(v, parent)
  true
end

Instance Method Details

#pairs(v) ⇒ Object



12
13
14
15
# File 'lib/vector_embed/maker/phrase.rb', line 12

def pairs(v)
  v = parent.preprocess v.to_s
  [ [ parent.index([k, v]), 1 ] ]
end