Module: Pgvector
- Defined in:
- lib/pgvector.rb,
lib/pgvector/pg.rb,
lib/pgvector/bit.rb,
lib/pgvector/vector.rb,
lib/pgvector/version.rb,
lib/pgvector/half_vector.rb,
lib/pgvector/sparse_vector.rb
Defined Under Namespace
Modules: PG
Classes: Bit, HalfVector, SparseVector, Vector
Constant Summary
collapse
- VERSION =
"0.3.2"
Class Method Summary
collapse
Class Method Details
.decode(string) ⇒ Object
19
20
21
22
23
24
25
26
27
|
# File 'lib/pgvector.rb', line 19
def self.decode(string)
if string[0] == "["
Vector.from_text(string).to_a
elsif string[0] == "{"
SparseVector.from_text(string)
else
string
end
end
|