WITHPROPERTY

Format:

WITHPROPERTY(ObjectToBeFound, WordStructureObject)
WITHPROPERTY({List of necessary objects}, WordStructureObject)
WITHPROPERTY({List of necessary objects}, {List of forbidden objects}}, WordStructureObject)

Sometimes it is desirable to look into an object in the grammar structure, to see whether it has (or has not) one or more particular properties. Consider the example of "the same rate of payment as the rate...".

"the same rate" will be turned into a noun phrase, which could be a subject noun phrase, an object noun phrase, or any one of the other noun phrases. Rather than trying to overload its name with the "same" property, it is easier to check whether it has the effect of the "same" property using the WITHPROPERTY operator, as

STRUCTURE1(.............,{NOCONNECT(WITHPROPERTY(SameObject, NounPhrase)),..........})

With this filtering structure, any noun phrase whose internals carry the desired property (SameObject is a parent of the word "same") will be accepted. It also means that it is not necessary to artificially combine the individual words of the noun phrase to make this work - all its words are checked for parents.

Properties need to be accessible at higher levels - the noun phrase may have been folded into a Prepositional Phrase, or the particular preposition used in a Prepositional Phrase may be of interest. For objects with multiple constituents, like Prepositional Phrases, all their constituents are gathered, and the property checked for presence among them and their parents (checkparents is used).

This operator is expensive, so should be used sparingly. It is so expensive, and the rule structure using it will usually be so rare (1 in 10,000, say), that it checks the rule structure control is true before proceeding. This way, high cost rule structures can be switched on only when specific words are encountered during tokenising.

Related Operators

ADDPROPERTY
ANDWITH
NOTCONSISTENT
NOTWITH

STRUCTURE1