.


:




:

































 

 

 

 





.

[ the, cat, scares, the, mice]

, . 21,2, ; , . [ tlie, mice] , nounjphrase ( ), [ scares, the, mice] , verb_phrase { ). . 21.2, .



II. Prolog


Sentence


Determiner

the


Noun_phrase


T.,',1


Verb phrase

/ \

Verb noun phrase

I /\

Scares determiner noun


The mice

. SI.2, "the cat scares the mice" ( , )

. .

1. .

2. ; , .

3. - ; ,

Gt;, q, .

s, , q {. 21.3).

/1\

. 21.3. s p. q

, , , . DCG. Prolog, , . , "the cat" : nounjphrase{ determiner! the), noun(cat))

DCG . , : noim_phrase (DetTree, NounTree)

21. 517


DetTree NounTree (determiner) (noun). , , : noun phrase[ noun phrase(DetTree, NounTree)) -> determiner(DetTree), noun; NounTree).

, .

, nounphra-se (DetTree, HounTree), :

, DetTree;

, NounTree.

. . , sentence(Number, sentence(NP, VP!) ->

verb phrase(Number, verb phrase(Verb, NP)) --> verb (Number, Verb), _ noun_phrase(Numberl, NP).

noun phrase(Number, noun phrase(Det, Noun)) -->

determiner[ determiner! the)] -> [ the]. noun! singular, rsoun(cat)) -> [ cat]. noun{ pluralF ncurH cats)) -> [ cats].

Prolog Prolog. , , :

"■raw1 O VP), List, Rest):-

verb_phrase(Number, VP, Rest6, Rest).

Prolog , :

- sentence(Number, ParseTree, 1 the, mice, hate, the, cat], [J),

Mumber = plural

ParseTree = sentence; noun_pnrase(determiner[ the), noun[ mice)),

verb phrase{ verb(hate), noun phrase[ determiner! the),

_ (cat))))





:


: 2015-10-01; !; : 428 |


:

:

, - , ; , - .
==> ...

1268 - | 1301 -


© 2015-2024 lektsii.org - -

: 0.013 .