Quiddity.Recognition (ExQuiddity v0.1.2)

Copy Markdown View Source

What quiddity recognised in a part: its features, and what every face is.

This is quiddity's own recognition/6 document, read rather than reshaped, with three questions answered once at the door because everything downstream asks them:

  • by_family/1 — the records grouped under the family that found them;
  • owner/2 — which feature a given face belongs to, which is what turns a point a sensor landed on into a named feature;
  • every face accounted for — a face is part of a feature, part of the body (with the reason), refused, or unexplained. A file that reads without errors is not a promise every feature was found, and the unexplained faces are where that promise is kept honest.

Summary

Functions

The records a family found, and [] for a family that found none.

The families with records, and how many each found, biggest first.

The family a face's feature belongs to, or nil when no feature owns it.

What a face is: the id of the feature it belongs to, :body, :refused, or :unexplained.

Reads a recognition document, as the engine wrote it.

A record by its id ("holes/0"), or nil.

Every record, in the order the families are documented.

The faces no feature claims and nothing else explains.

The records whose evidence quiddity could not prove.

Types

face_owner()

@type face_owner() :: String.t() | :body | :refused | :unexplained | :unaccounted

t()

@type t() :: %Quiddity.Recognition{
  by_family: %{optional(String.t()) => [map()]},
  coordinate_space: String.t(),
  face_count: non_neg_integer(),
  face_owner: %{optional(non_neg_integer()) => face_owner()},
  failures: [map()],
  frame: map(),
  input_repairs: [String.t()],
  package: map(),
  records: [map()],
  run_mode: String.t(),
  schema_version: String.t(),
  source_sha256: String.t() | nil
}

Functions

by_family(recognition, family)

@spec by_family(t(), String.t()) :: [map()]

The records a family found, and [] for a family that found none.

families(recognition)

@spec families(t()) :: [{String.t(), non_neg_integer()}]

The families with records, and how many each found, biggest first.

family_of(recognition, face)

@spec family_of(t(), non_neg_integer()) :: String.t() | nil

The family a face's feature belongs to, or nil when no feature owns it.

This is the question a sensel asks: "what am I on?"

owner(recognition, face)

@spec owner(t(), non_neg_integer()) :: face_owner()

What a face is: the id of the feature it belongs to, :body, :refused, or :unexplained.

parse(document)

@spec parse(map()) :: t()

Reads a recognition document, as the engine wrote it.

record(recognition, id)

@spec record(t(), String.t()) :: map() | nil

A record by its id ("holes/0"), or nil.

records(recognition)

@spec records(t()) :: [map()]

Every record, in the order the families are documented.

unexplained_faces(recognition)

@spec unexplained_faces(t()) :: [non_neg_integer()]

The faces no feature claims and nothing else explains.

unproved(recognition)

@spec unproved(t()) :: [map()]

The records whose evidence quiddity could not prove.