Everything to do with trees, chiefly of the constituency grammar kind.
Functions dealing with tregex in CoreNLP (constituency grammar patterns) have
been wrapped so as to mimic the existing Clojure Core regex functions. The
tregex-result
function also mimics re-groups and serves a similar purpose,
although rather than returning groups it returns named nodes defined in the
pattern.
Everything to do with trees, chiefly of the constituency grammar kind. Functions dealing with tregex in CoreNLP (constituency grammar patterns) have been wrapped so as to mimic the existing Clojure Core regex functions. The `tregex-result` function also mimics re-groups and serves a similar purpose, although rather than returning groups it returns named nodes defined in the pattern.
(tregex-find m)
(tregex-find p t)
Return the next tregex match, if any, of tokens to pattern, using TokenSequenceMatcher.find().
Return the next tregex match, if any, of tokens to pattern, using TokenSequenceMatcher.find().
(tregex-matcher p t)
Create a TregexMatcher from p
and Tree t
; use in tregex-find.
Create a TregexMatcher from `p` and Tree `t`; use in tregex-find.
(tregex-matches p t)
Returns the match, if any, of tokens to pattern, using edu.stanford.nlp.trees.tregex.TregexMatcher.matches(). Uses tregex-result to return any named nodes.
Returns the match, if any, of tokens to pattern, using edu.stanford.nlp.trees.tregex.TregexMatcher.matches(). Uses tregex-result to return any named nodes.
(tregex-pattern s)
Return an instance of TregexPattern, for use, e.g. in tregex-matcher.
Return an instance of TregexPattern, for use, e.g. in tregex-matcher.
(tregex-result m)
Returns the named nodes from the most recent match/find. If there are no named nodes/relations, returns the match itself. If there are named nodes/relations, returns a vector with the first element being the match itself and the second a map of names -> nodes.
Returns the named nodes from the most recent match/find. If there are no named nodes/relations, returns the match itself. If there are named nodes/relations, returns a vector with the first element being the match itself and the second a map of names -> nodes.
(tregex-seq p t)
Return a lazy list of matches of TregexPattern p
in Tree t
.
Return a lazy list of matches of TregexPattern `p` in Tree `t`.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close