-
Notifications
You must be signed in to change notification settings - Fork 9
/
example_output.txt
112 lines (94 loc) · 2.68 KB
/
example_output.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
Grammar file readed succesfully. Rules readed:
S --> NP VP
PP --> P NP
VP --> V NP
VP --> VP PP
NP --> NP PP
NP --> astronomers
NP --> ears
NP --> saw
V --> saw
NP --> telescope
NP --> stars
P --> with
Applied Rule: VP[2,2] --> V[1,2] NP[1,3]
Applied Rule: PP[2,4] --> P[1,4] NP[1,5]
Applied Rule: S[3,1] --> NP[1,1] VP[2,2]
Applied Rule: NP[3,3] --> NP[1,3] PP[2,4]
Applied Rule: VP[4,2] --> V[1,2] NP[3,3]
Applied Rule: VP[4,2] --> VP[2,2] PP[2,4]
Applied Rule: S[5,1] --> NP[1,1] VP[4,2]
Applied Rule: S[5,1] --> NP[1,1] VP[4,2]
----------------------------------------
The sentence IS accepted in the language
Number of possible trees: 2
----------------------------------------
----------- ------------ ------ ------ ------
['S', 'S']
[] ['VP', 'VP']
['S'] [] ['NP']
[] ['VP'] [] ['PP']
['NP'] ['NP', 'V'] ['NP'] ['P'] ['NP']
astronomers saw stars with ears
----------- ------------ ------ ------ ------
Grammar file readed succesfully. Rules readed:
S --> NP VP
VP --> VP PP
VP --> V NP
VP --> eats
V --> eats
PP --> P NP
NP --> Det N
NP --> she
P --> with
N --> fish
N --> fork
Det --> a
Applied Rule: S[2,1] --> NP[1,1] VP[1,2]
Applied Rule: NP[2,3] --> Det[1,3] N[1,4]
Applied Rule: NP[2,6] --> Det[1,6] N[1,7]
Applied Rule: VP[3,2] --> V[1,2] NP[2,3]
Applied Rule: PP[3,5] --> P[1,5] NP[2,6]
Applied Rule: S[4,1] --> NP[1,1] VP[3,2]
Applied Rule: VP[6,2] --> VP[3,2] PP[3,5]
Applied Rule: S[7,1] --> NP[1,1] VP[6,2]
----------------------------------------
The sentence IS accepted in the language
Number of possible trees: 1
----------------------------------------
------ ----------- ------- ----- ------ ------- -----
['S']
[] ['VP']
[] [] []
['S'] [] [] []
[] ['VP'] [] [] ['PP']
['S'] [] ['NP'] [] [] ['NP']
['NP'] ['VP', 'V'] ['Det'] ['N'] ['P'] ['Det'] ['N']
she eats a fish with a fork
------ ----------- ------- ----- ------ ------- -----
Grammar file readed succesfully. Rules readed:
S --> NP VP
VP --> VP PP
VP --> V NP
VP --> eats
V --> eats
PP --> P NP
NP --> Det N
NP --> she
P --> with
N --> fish
N --> fork
Det --> a
Applied Rule: VP[2,1] --> V[1,1] NP[1,2]
Applied Rule: NP[2,4] --> Det[1,4] N[1,5]
--------------------------------------------
The sentence IS NOT accepted in the language
--------------------------------------------
----------- ------ ----- ------- -----
[]
[] []
[] [] []
['VP'] [] [] ['NP']
['VP', 'V'] ['NP'] ['N'] ['Det'] ['N']
eats she fork a fish
----------- ------ ----- ------- -----