I have a question about parsing a simple french -> english translator
it is defined as
FS->FNP FVP
FNP -> FNP1
FNP-> FNP2
FNP1-> FPRN
FNP2-> FDET FNOUN
FVP-> FNP1 FVERB
FVP-> FVERB FNP2
FPRN -> {list of words}
FDET-> {list of words}
FVERB-> {list of words}
FNOUN-> {list of words}

Here is the parser that was given to us as an example.

proc {S P0 P}
   P1 in
   {NP P0 P1}
   {Browse P0.1}
   {VP P1 P}
   {Browse P1.1}
   {Browse 'Acceptable Sentance'}
end
proc{NP P0 P}
   choice
      P0 = John|P
   [] P0 = Mary|P
   end
end
proc{VP P0 P}
   choice
      P0 = whistles|P
   [] P0 = walks|P
    end
end

Do I need to write each value from the list in these procedures(I obviously
need to still write the procedures), however it seems very innefficent to
have to write every choice in these procedure.

And am I on the right track by writing say FNP as below, and then writing
another procedure for FNP1 and FNP2?  or am I over thinking this?
proc{FNP P0 P}
    choice
         P0 = FNP1|P
       []P0 = FNP2|P
    end
end



-- 
Kurt Breitsprecher
(807) 474-9601
[email protected]
_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to