I have a list of word forms produced from a text. This list includes proper names (e.g. John, Mary, Edinburgh). In another field I have a list of proper names. I want to get a list of all word forms without the proper names.
I actually need
allWordForms MINUS properNames
Arrays may be used like sets. But we only have the set operations Union
and Intersect
.
The script so far
on mouseUp
put field "allWordForms" into tWordForms
split tWordForms by return
-- tWordForms is now an array
put field "properNames" into tProperNames
split tProperNames by return
-- tProperNames is now an array
-- .....
repeat
-- .....
-- .....
end repeat
combine tWordForms using return
put tWordForms into field "wordFormsWithoutProperNames"
end mouseUp
How does the repeat loop look like?
And here is an example.
The field "allWordForms" contains
Mary
and
John
came
yesterday
They
want
to
move
from
Maryland
to
Petersbourough
`
The field "properNames" contains
John
Mary
Maryland
Peter
Petersbourough
The desired result is to have a copy of the list allWordForms
with the proper names removed.
and
came
yesterday
They
want
to
move
from
to