(create-zipper pattern)
Create a zipper out of the root pattern
, where each node is a
Pattern and its sub-Patterns/Templates are its children.
Create a zipper out of the root `pattern`, where each node is a Pattern and its sub-Patterns/Templates are its children.
(grow-pattern-tree pattern objects-map)
Build a tree data structure out of a Pattern using zippers. Each internal node is a Pattern and each leaf node is a Template.
Build a tree data structure out of a Pattern using zippers. Each internal node is a Pattern and each leaf node is a Template.
(mapify-all {:keys [templates patterns] :as _profile})
Put all Templates and Patterns of a profile into a unified map.
Put all Templates and Patterns of a profile into a unified map.
(pattern-tree->dfa pattern-tree)
(pattern-tree->dfa pattern-tree stmt-ref-opts)
Given pattern-tree
(returned by grow-pattern-tree
), construct a
minimized DFA to read xAPI statements.
Given `pattern-tree` (returned by `grow-pattern-tree`), construct a minimized DFA to read xAPI statements.
(pattern-tree->nfa pattern-tree)
Given pattern-tree
(returned by grow-pattern-tree
), return an NFA
with metadata associating each state with the corresponding
template-pattern path that they are derived from. Unlike the FSM
returned by pattern->fsm
, the predicates take in ID strings, not xAPI
Statements, as input.
Given `pattern-tree` (returned by `grow-pattern-tree`), return an NFA with metadata associating each state with the corresponding template-pattern path that they are derived from. Unlike the FSM returned by `pattern->fsm`, the predicates take in ID strings, not xAPI Statements, as input.
(primary-patterns profile)
Get a sequence of all of the primary Patterns in a Profile.
Get a sequence of all of the primary Patterns in a Profile.
(profile->fsms profile)
(profile->fsms profile {:keys [statement-ref-fns compile-nfa? select-patterns]})
Given a Profile, returns a map between primary Pattern IDs and their respective FSMs that can perform Statement validation. Assumes a valid Profile.
Given a Profile, returns a map between primary Pattern IDs and their respective FSMs that can perform Statement validation. Assumes a valid Profile.
(read-visited-templates nfa template-ids)
(read-visited-templates nfa nfa-meta template-ids)
Given nfa
returned by pattern-tree->nfa
, read in the template-ids
sequence and return the path of Patterns and Templates that was taken
during the original matching process. If template-ids
is empty or
represents an invalid input sequence, return an empty seq.
Given `nfa` returned by `pattern-tree->nfa`, read in the `template-ids` sequence and return the path of Patterns and Templates that was taken during the original matching process. If `template-ids` is empty or represents an invalid input sequence, return an empty seq.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close