You are on page 1of 3

LABORATORY WORK NR.

1
at NLP
Phrase Structure Grammars
s

Phrase structure:
np

vp

String Y

String Z

Phrasal categories: s, np, vp, etc.

Lexical categories: n, v, adv, adj, etc.

Example: Moldova has a rich culture.

Moldova
n1

has

rich

culture.

art

adj

n2

np1

np2
vp

/* Syntactic Rules: */
s--> np1,vp.
np1-->n1.
vp-->v,np2.
np2-->art,adj,n2.

/* Lexical Rules */
n1-->[moldova].
v-->[has].
art-->[a].
adj-->[rich].
n2-->[culture];[history].
GOAL:
?-phrase(s,[moldova,has,a,rich,culture]).
YES
?-phrase(vp,[has,a,rich,culture]).
YES.
?-phrase(s,[moldova,has,a,rich,X]).
X=culture;
X=history;
NO.
?-phrase(s,[moldova,has,a,culture]).
NO.

/* question1 */
/* answer1 */
/* question2 */
/* answer2 */
/* question3 */
/* answer3 */
/* question4 */
/* answer4 */

TASK FOR LABORATORY WORK NR.1: Do the analysis of 3 English sentences applying Definite
Clause Grammar rules in SWI-PROLOG.

Presentation: 1. at the lesson you get the task; 2. electronically in MSWord; 3. use SWI-Prolog to show
the results; 4. answer the teachers questions (e.g. Whats NLP?)
Variante:
Variantele se aleg conform numrului n catalog

1. Children sing on special occasions.


Water slakes thirst.
John brushes his teeth every morning.
2. Carol usually drives to work.
The teacher grades homework on Fridays.
Hawaii is in the Pacific Ocean.
3. Some birds fly south for the winter.
Water consists of hydrogen and oxygen.
John brushes his teeth every morning.
4. Pretty women enjoy sunny day.
Little boy kissed his young mother.
Red balloon fly to the blue sky.
5. Cory and Lori are twins.
They ride the bus to school every day.
Then she takes a shower and brushes her teeth.
6. She has blonde hair and wears glasses.
The brown dog with the red collar always barks loudly.
The young boy quickly climbed a tall tree.
7. My friend enjoyed the film.
My mother likes dogs that don't bark.
Beer and wine are my favorite drinks.
8. Some of the English customs are interesting.
Sunday is a very quiet day in London.
They often go down to the sea for the day.
9. Very few people have servants in their homes.
Men raise their hats to women but not to each other.
The using of the first name depends on a number of factors.
10. Experienced sieves stole a piece of gold.
Little boy broke a cup of tea.
Palm trees grow near the big city.
11. The football championship is pointed on next day.
Computer program is working fast on modern computers.
The verb is the fundamental part of the sentence.

12. Some students like to study in the mornings.


Juan and Arturo play football every afternoon.
Alicia goes to the library and studies every day.
13. Alejandro played football, so Maria went shopping.
The students are studying because they have a test tomorrow.
Juan and Maria went to the movies.
14. The woman who called my mom sells cosmetics.
The book that Jonathan read is on the shelf.
The town where I grew up is in the United States.
15. Vienna has a rich history.
He helps in the shop.
John drives the children to school.
16. He makes breakfast for the hotel guests.
My weekends are fast and exciting.
There are some magazines on the table.
17. The football championship is pointed on next day.
Computer program is working fast on modern computers.
The verb is the fundamental part of the sentence.

18. Experienced sieves stole a piece of gold.


Little boy broke a cup of tea.
Palm trees grow near the big city.
19. The bathroom is next to the living room.
He wants to buy another plane.
His family owned a big farm and had slaves

You might also like