Liking cljdoc? Tell your friends :D

instacheck.weights


distance-trekclj/s

(distance-trek grammar)

Given a grammar and a wtrek, return dtrek with distance to reach every node of grammar.

Given a grammar and a wtrek, return dtrek with distance to reach
every node of grammar.
sourceraw docstring

filter-trek-weightedclj/s

(filter-trek-weighted trek)

Given trek, only keep paths that refer to weighted nodes (:alt, :ord, :opt, :star). In a generator context, these are the nodes that use (igen/freq).

Given trek, only keep paths that refer to weighted nodes (:alt,
:ord, :opt, :star). In a generator context, these are the nodes that
use (igen/freq).
sourceraw docstring

likelihood-trekclj/s

(likelihood-trek grammar wtrek)

Given a grammar and a wtrek, return an ltrek with the likelihood of reaching every node of grammar.

Given a grammar and a wtrek, return an ltrek with the likelihood of
reaching every node of grammar.
sourceraw docstring

path-log-trekclj/s

(path-log-trek grammar parse-result)

Takes a grammar and parse-result parsed using that grammar and returns a path-log trek based on the :path-log in parse-result. Note that this will return a different set of paths than a normal trek or wtrek because it contains "weights" for all nodes of the grammar and not just for leaf or weighted nodes.

Takes a grammar and parse-result parsed using that grammar and
returns a path-log trek based on the :path-log in parse-result. Note
that this will return a different set of paths than a normal trek or
wtrek because it contains "weights" for all nodes of the grammar
and not just for leaf or weighted nodes.
sourceraw docstring

path-log-wtrekclj/s

(path-log-wtrek grammar parse-result)

Takes a grammar and parse-result parsed using that grammar and returns a wtrek with weights set based on the :path-log in parse-result. Note that this will return different paths than a normal trek because a wtrek contains all weighted nodes (:alt, :ord, :opt, :star) from the grammar not just leaf nodes.

Takes a grammar and parse-result parsed using that grammar and
returns a wtrek with weights set based on the :path-log in
parse-result. Note that this will return different paths than
a normal trek because a wtrek contains all weighted nodes (:alt,
:ord, :opt, :star) from the grammar not just leaf nodes.
sourceraw docstring

(print-weights weights)
source

removed-node?clj/s

(removed-node? grammar weights path)

Takes path to a grammar node and returns true if all the child weights of this node are 0. Only paths ending in :alt, :ord, :opt, and :star can have child weights).

Takes path to a grammar node and returns true if all the child
weights of this node are 0. Only paths ending in :alt, :ord, :opt,
and :star can have child weights).
sourceraw docstring

save-weightsclj/s

(save-weights path weights)
source

terminal-likelihood-trekclj/s

(terminal-likelihood-trek grammar wtrek)
source

wtrekclj/s

(wtrek grammar & [default-weight])

Takes a grammar and returns a wtrek/weight trek (map of grammar paths to weight values). If the node at a path has a comment with a :weight specification then this will be used for the weight otherwise the default-weight parameter will be used (with a default of 100). Note that this will return different paths than a normal trek because a wtrek contains all weighted nodes (:alt, :ord, :opt, :star) from the grammar not just leaf nodes.

Takes a grammar and returns a wtrek/weight trek (map of grammar
paths to weight values). If the node at a path has a comment with
a :weight specification then this will be used for the weight
otherwise the default-weight parameter will be used (with a default
of 100). Note that this will return different paths than a normal
trek because a wtrek contains all weighted nodes (:alt, :ord, :opt,
:star) from the grammar not just leaf nodes.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close