tastoids/tastoid
Types
pub type Impression {
Yum
Yuck
Meh
Saw(worth: Float)
Pass
}
Constructors
-
Yum
I liked it, +1
-
Yuck
I disliked it, -1
-
Meh
I saw it, and ignoring it is worth ~ -5%
-
Saw(worth: Float)
I saw it, ascribing scaling it by weight
-
Pass
I saw it, and have absolutely no impression
A Tastoid
(𝕥) is an element within a subset of Tastoids (𝕋),
constrained to only interact with other tastoids of
the same
imbedding indices ( Imbedding(space)
).
pub type Tastoid(of) {
Tasteless
Tastoid(taste: taste.Taste, cardinality: Int)
}
Constructors
-
Tasteless
The empty Tastoid (shared by all index-spaces)
-
Tastoid(taste: taste.Taste, cardinality: Int)
An impression (or aggregation) of taste e.g. Tastoid(t) -> Tastoids(t, 1)
Values
pub fn from(thing name: String) -> Tastoid(String)
Coerce a thing
of an into a Tastoid
, assuming…
- The
thing
’s type is theImbedding(space)
of theTastoid
- The sentiment of that thing is
1.0
~ a count of its occurances
In effect, from(thing)
is 1
of that thing, as a Tastoid
Example:
"from" |> tastoid.from -> Tastoid(Taste("from", 1.0"), k=1)
42 |> tastoid.from -> Tastoid(Taste(42, 1.0), k=1)
pub fn from_dense_embedding(values: List(Float)) -> Tastoid(a)
Experimental: A (quiet) naive dense -> sparse
mapper to facilitate experimentation
(see test/playground/fruit.gleam
)
pub fn from_impression(
of thing: String,
worth sentiment: Impression,
) -> Tastoid(String)
Given any index (string
, Int
, or `Set(index)``), coerce it into
a simple Tastoid worth a single contribution (k=1)
pub fn from_sparse_embedding(
values: List(Float),
by indices: List(Int),
) -> Tastoid(Int)
Coerce a sparse/dense embeddings pair of value and index lists into a conjugated Tastoid worth a single contribution (k=1)
pub fn from_taste(
of taste: taste.Taste,
worth impression: Impression,
) -> Tastoid(index)
A tasting of a taste and the impression thereof (e.g. a ‘weight’ or value-multiplier) yield a Tastoid of cardinality (k=1).