(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.
(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).
(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.
(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.
(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.
(print-weights weights)
(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).
(save-weights path weights)
(terminal-likelihood-trek grammar wtrek)
(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.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close