This component parses a phrase and extracts information based on rules. The two main phases are matching and production.
This component parses a phrase and extracts information based on rules. The two main phases are matching and production. 1. rules are transformed into objets via rules macro 2. rules are (recursively) matched based on theirs pattern vectors. 3. tokens containing final info are produced using their production rules
(build-rule name pattern production)
Builds a new rule
Builds a new rule
(estimate-confidence context module tokens)
Returns the tokens with :confidence a rough confidence estimation for each. Numbers covered by datetime are very unlikely.
Returns the tokens with :confidence a rough confidence estimation for each. Numbers covered by datetime are very unlikely.
(export-value token opts)
Transforms a token value for API output. Returns the modified value.
Transforms a token value for API output. Returns the modified value.
(maxlen-judge stash)
Choose the winning token in the stash.
Choose the winning token in the stash.
(pass-all sentence rules base-stash)
Make as many passes as necessary until no new tokens are produced (there is a limit to avoid infinite loops though)
Make as many passes as necessary until no new tokens are produced (there is a limit to avoid infinite loops though)
(pattern-fn pattern)
Makes a pattern function from the pattern slice (regex...)
Makes a pattern function from the pattern slice (regex...)
(resolve-token token context module)
Resolve a token based on its dimension, predicate, and the context. Returns a coll of tokens, since they can have multiple resolutions, or none. Unresolved tokens are returned as is, without a :value key.
Resolve a token based on its dimension, predicate, and the context. Returns a coll of tokens, since they can have multiple resolutions, or none. Unresolved tokens are returned as is, without a :value key.
(rules forms)
Parses a set of rules and 'add' them into 'the-rules'. Can be called several times, since rules might spread into several files.
Parses a set of rules and 'add' them into 'the-rules'. Can be called several times, since rules might spread into several files.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close