Information Technology Reference
In-Depth Information
Figure 8.15.
A parser for declaratives
declarative.pl
simple_declarative(String) :-
split_words(String,Words),
% Get words from string.
sd(Words).
% Use sd on the words.
sd(Words) :-
append(NP1,[is,Prep|NP2],Words),
% Split words.
np(NP1,X),
% Find referent for first NP.
np(NP2,Y),
% Find referent for second NP.
add_for_preposition(Prep,X,Y).
% Add new atom to database.
No attempt is made here to ensure that the new information is reasonable , however.
(As it stands, for example, people could end up being located at more than one place.)
8.4 Nonreferential noun phrases
The sort of natural language processing described in this chapter is really just the
start. What makes language so interesting is that it can be used in ways that are much
more versatile than hinted at here.
For both the interrogative and declarative sentences that have been examined, noun
phrases were used to refer to some known individual in the world model. But not all
noun phrases are referential in this sense.
Consider the following: a man without a hat . This is like previous noun phrases
using the preposition without . However, in this example, the noun phrase a hat is not
used referentially; it would be a mistake to look in the world model for the hat that
is being referred to. Indeed, the reference is to a man for whom there is no such hat.
(The program clearly needs to be redesigned with respect to prepositional phrases
that start with the word without .)
Similarly, for the sentence Mary eats an apple every day , one should not look for the
object referred to by the noun phrase an apple . There is no single object that Mary
eats over and over; each day it is a different one. The following sentence, on the other
hand, is semantically ambiguous: John wants to marry a rich lawyer. The phrase a rich
lawyer may be referential in designating somebody (say, Susan) whom John wants
to marry and who happens to be a rich lawyer. Or it may be nonreferential in that
there is no particular individual that John has in mind: whoever it will turn out to be,
however, he wants her to be both rich and a lawyer.
 
 
Search WWH ::




Custom Search