Common Lisp Package: UNIFGRAM

README:

FUNCTION

Private

ADD-EXAMPLES (CATEGORY ARGS EXAMPLES)

Add these example strings to this category, and when it comes time to run them, use the args.

AND*/2 (IN OUT CONT)

IN is a list of conjuncts that are conjoined into OUT.

COLLECT-SEMS (BODY ?SEM)

Get the semantics out of each constituent in body, and combine them together into ?sem.

CONJ-CATEGORY (PREDICATE)

If this is a conjunctive predicate, return the Cat_ symbol.

CONJUNCTS (EXP)

Get all the conjuncts from an expression.

DEBUG (&REST IDS)

Start dbg output on the given ids.

HANDLE-CONJ (HEAD)

Replace (Cat ...) with (Cat_ ...) if Cat is declared as a conjunctive category.

MAKE-AUGMENTED-DCG (HEAD BODY)

Build an augmented DCG rule that handles :sem, :ex, and automatic conjunctiontive constituents.

MAKE-DCG-BODY (BODY N)

Make the body of a Definite Clause Grammar (DCG) clause. Add ?string-in and -out variables to each constituent. Goals like (:test goal) are ordinary Prolog goals, and goals like (:word hello) are literal words to be parsed.

REMOVE-PUNCTUATION (STRING)

Replace punctuation with spaces in string.

RUN-EXAMPLES (&OPTIONAL CATEGORY)

Run all the example phrases stored under a category. With no category, run ALL the examples.

STRING->LIST (STRING)

Convert a string to a list of words.

SYMBOL (&REST ARGS)

Concatenate symbols or strings to form an interned symbol

Undocumented

CLEAR-EXAMPLES

DCG-NORMAL-GOAL-P (X)

DCG-WORD-LIST-P (X)

GET-EXAMPLES (CATEGORY)

MAKE-DCG (HEAD BODY &OPTIONAL (OP '<-))

MAKE-DCG! (HEAD BODY)

PUNCTUATION-P (CHAR)

MACRO

Public

RULE (HEAD &OPTIONAL (ARROW '-) &BODY BODY)

Expand one of several types of logic rules into pure Prolog.

Private

CONJ-RULE ((CONJ-CAT SEM1 COMBINED-SEM) ==> CONJ (CAT . ARGS))

Define this category as an automatic conjunction.

VARIABLE

Private

Undocumented

*EXAMPLES*