Liking cljdoc? Tell your friends :D

duckling.engine

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
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
raw docstring

build-ruleclj

(build-rule name pattern production)

Builds a new rule

Builds a new rule
sourceraw docstring

estimate-confidenceclj

(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.
sourceraw docstring

export-valueclj

(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.
sourceraw docstring

maxlen-judgeclj

(maxlen-judge stash)

Choose the winning token in the stash.

Choose the winning token in the stash.
sourceraw docstring

pass-allclj

(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)
sourceraw docstring

pattern-fnclj

(pattern-fn pattern)

Makes a pattern function from the pattern slice (regex...)

Makes a pattern function from the pattern slice (regex...)
sourceraw docstring

resolve-tokenclj

(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.
sourceraw docstring

rulesclj

(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.
sourceraw docstring

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

× close