learning to parse
[1/6] from: chaz:innocent at: 6-Oct-2000 23:58
Rebol []
nounphrase: [
Americans
|
Australians
|
Dutch
|
Germans
|
REBOLs
]
predphrase: [
understand
|
rule
|
script
|
travel
|
]
string: "REBOLs rule"
parse string [nounphrase predphrase]
chaz
REBOL[] print enbase/64 #{26EB2D027A2D85EAFE44404E2FE1DA7247AB} ask []
[2/6] from: chaz:innocent at: 7-Oct-2000 0:11
Rebol []
nominal: [
"Americans" |
"Australians" |
"Dutch" |
"Germans" |
"REBOLs"
]
determiner: [
"Attractive" |
"Intelligent" |
"Visionary"
]
nounphrase: [determiner nominal]
predphrase: [
understand
|
rule
|
script
|
travel
|
]
string: "Intelligent REBOLs understand"
parse string [nounphrase predphrase]
chaz
REBOL[] print enbase/64 #{26EB2D027A2D85EAFE44404E2FE1DA7247AB} ask []
[3/6] from: chaz:innocent at: 7-Oct-2000 1:05
I'm going through a book called "The New English Grammar: A Descriptive
Introduction" by N.R. Cattell, copyright 1969, isbn 0 262 53 015 5 (first
published 1966 as "The Design of English" by Heinemann Educational Books,
Ltd.)
I've learned that parsing is very dependent on the word classes
("constituents") chosen, and the order of these constituents.
Problem. I'm trying to reuse the constituent "nounphrase", and it doesn't
seem to be working. Any ideas?
Rebol []
nominal: [
"Americans" |
"Australians" |
"Dutch" |
"Germans" |
"REBOLs" |
"Masses"
]
determiner: [
"Attractive" |
"Intelligent" |
"Visionary" |
"Dangerous"
"The" |
"Complacent" |
none
]
nounphrase: [determiner nominal]
particle: [
up
|
out
|
over
|
away
|
none
]
verbintransitive: [
understand
|
rule
|
script
|
travel
|
triumph
]
;verbphrase: [verbintransitive particle nounphrase]
verbphrase: [verbintransitive particle nounphrase]
preverb: [
always
|
fortunately
|
certainly
|
none
]
auxiliary: [
will
|
shall
|
should
|
must
|
none
]
predphrase: [ auxiliary preverb verbphrase]
string: "Complacent Masses will always triumph over Dangerous REBOLs"
parse string [nounphrase predphrase]
chaz
REBOL[] print enbase/64 #{26EB2D027A2D85EAFE44404E2FE1DA7247AB} ask []
[4/6] from: al:bri:xtra at: 7-Oct-2000 2:55
> determiner: [
> "Attractive" |
<<quoted lines omitted: 5>>
> none
> ]
I hope that helps!
Andrew Martin
ICQ: 26227169
http://members.nbci.com/AndrewMartin/
[5/6] from: chaz::innocent::com at: 8-Oct-2000 1:27
nounphrase: [
"Andrew"
]
predphrase: [
"Rules!"
]
string: "Andrew Rules!"
parse string [nounphrase predphrase]
chaz
REBOL[] print enbase/64 #{26EB2D027A2D85EAFE44404E2FE1DA7247AB59A9ED4E805E}
ask []
At 02:55 AM 10/7/00 -0800, you wrote:
[6/6] from: al:bri:xtra at: 8-Oct-2000 2:34
>> nounphrase: [
[ "Andrew"
[ ]
== [
"Andrew"
]
>>
>> predphrase: [
[ "Rules!"
[ ]
== [
"Rules!"
]
>>
>> string: "Andrew Rules!"
== "Andrew Rules!"
>> parse string [nounphrase predphrase]
== true
Andrew Martin
Toot! Toot!
ICQ: 26227169
http://members.nbci.com/AndrewMartin/
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted