nltk.sem.cooper_storage module

class nltk.sem.cooper_storage.CooperStore[source]

Bases: object

A container for handling quantifier ambiguity via Cooper storage.

__init__(featstruct)[source]
Parameters

featstruct (FeatStruct (with features core and store)) – The value of the sem node in a tree from parse_with_bindops()

s_retrieve(trace=False)[source]

Carry out S-Retrieval of binding operators in store. If hack=True, serialize the bindop and core as strings and reparse. Ugh.

Each permutation of the store (i.e. list of binding operators) is taken to be a possible scoping of quantifiers. We iterate through the binding operators in each permutation, and successively apply them to the current term, starting with the core semantic representation, working from the inside out.

Binding operators are of the form:

bo(\P.all x.(man(x) -> P(x)),z1)
nltk.sem.cooper_storage.demo()[source]
nltk.sem.cooper_storage.parse_with_bindops(sentence, grammar=None, trace=0)[source]

Use a grammar with Binding Operators to parse a sentence.