ERROR CORRECTION ---------------- The correction3.lisp code is basically the correction2.lisp code with a few modifications and additions: rewrite-parse will now return the error messages and corrections as a value, and it allows for pre and post procesing your strings. REWRITE-PARSE-SERVER (also REWRITE-WPARSE-SERVER [word based]) -------------------- You can now run the parser as server. This will send the errors and corrections to a file. > (rewrite-parse-server) (NOTE: you will need to have all of your grammar and feedback files loaded.) Run this and the LISP will wait for you to create a file called "sentence.input" with a single line containing a sentence. Then you should create "glr-ready.input" to signal the parser to read in the sentence file and process it with rewrite-parse. The error and correction output will be sent to "rewrites.output" in the form of 1 line with the error listed and the next line with the corrected sentence. If the parse is ambiguous, there will be pairs of errors and corrections in the file listed one after the other. INPUT: Los hombres es felices. EXAMPLE multiple output: Verb agreement error. Los hombres son felices. SUBJ number error El hombre es feli'z. A flag file will be created called: "glr-ready.output" that you should use to let your program know that the parser is done writing output the output. (Warning: LISP is slower than most other languages. So do not try to read the output file before LISP signals that it is done. And sometimes Perl slows down enough that LISP is faster. ) STRING PROCESSING ----------------- There is pre and post processing available, but you should write your own rules for this in your init file. Or you can bi-pass these rules by doing the string processing in the main body of your code for the exercise. INPUT: "xxx" (setq *preprocess* '(("xxx" "yyy"))) PARSER INPUT: "yyy" PARSER OUTPUT: "yyy" (setq *postprocess* '(("yyy" "zzz"))) FINAL PARSER OUTPUT: "zzz" To use the pre and post processing, you will need to load a file called string.lsp that can be found here: /afs/cs/project/cmt-55/lti/Lab/Modules/MCALL-717/string.lsp FEEDBACK -------- The error messages (feedback) for a single parse will appear seperated by " @@@@@ " (by default) if there is more than one. Example: El hombres es felices. Subj verb agreement error. @@@@@ Determiner noun agreement ERROR. Los hombres son felices. You can use a different seperator string by adding this to your init file: (setq *error-seperator* "") EXITING rewrite-parse-server or rewrite-wparse-server -------- While running the server version, you can signal LISP to stop running the server by creating the file: "glr.quit" The server will stop. You can then exit LISP normally.