eta.util.tt.preds

Definitions for custom evaluable predicates used in TT patterns.

Definitions for custom evaluable predicates used in TT pattern matching and template filling, based on the original LISP definitions: https://github.com/bkane2/eta/blob/master/core/tt/tt-match-predicates.lisp

Some simplifications were made here, limiting the extensibility and (to a small extent) efficiency of custom predicates. First, due to Python lacking a macro system, all predicates must be defined here, rather than in domain-specific rule files. Second, predicate functions are invoked based on name strings, obtained through manipulation of the corresponding variable strings, rather than through the implicit-pred and *-variant hash tables.

Ultimately, this should be reworked to allow custom domain-specific definitions of TT predicates, in order to avoid the redundant loading of lexical data into the core code.

Functions

affirm_adv

Matches any affirmatory modifier.

comma

Match a comma.

lex_ulf

ULF lexicalizer predicate.

modal

Matches any modal word.

non_neg

Match any word except for negative polarity items.

non_neg_mod

Matches any word except for negative polarity items or negative modifiers.

prefix_each

Cons prefix to each list in lst.

quote_to_list

Predicate to create a word list from a quoted expression.

split_sentences

Predicate to split a word list into multiple word lists for each sentence.

zero

Match zero.

comma(x)[source]

Match a comma.

zero(x)[source]

Match zero.

non_neg(x)[source]

Match any word except for negative polarity items.

non_neg_mod(x)[source]

Matches any word except for negative polarity items or negative modifiers.

affirm_adv(x)[source]

Matches any affirmatory modifier.

modal(x)[source]

Matches any modal word.

lex_ulf(cat, word)[source]

ULF lexicalizer predicate.

quote_to_list(s)[source]

Predicate to create a word list from a quoted expression.

split_sentences(wordlist)[source]

Predicate to split a word list into multiple word lists for each sentence.

prefix_each(prefix, lst)[source]

Cons prefix to each list in lst.