[developers] Preprocessor, again

Ben Waldron bmw20 at cl.cam.ac.uk
Thu Jul 6 13:56:32 CEST 2006


I've fixed the bug you mention below. Sorry about that.

The span was okay in the second instance below (but the characters were 
not) because the '.' blocks the match. The substitution operator "-" 
applies to whole tokens, and hence the spelling correction would need to 
be written as something like

-chears([.?!,;":\)]*)    cheers\1

in order for it to fire. This is the mechanism used by the ERG for 
ersatzes, in fact:

^([\(]*)[0-9]+\.[0-9]+([.?!,;":\)]*)        \1DecimalErsatz\2

Dan, I didn't get the original email. Please could you forward it to me?

Thanks,
- Ben

PS. When I load the latest ERG from the lingo CVS, using the latest LKB 
from the same repository, I get a number of warning messages:

; While compiling (:TOP-LEVEL-FORM "mt.lsp" 258) in 
/home/bmw20/erg/lkb/mt.lsp:
Warning: Free reference to undeclared variable
         %TRANSFER-PROPERTIES-ACCUMULATOR% assumed special.
; While compiling (:TOP-LEVEL-FORM "mt.lsp" 304) in 
/home/bmw20/erg/lkb/mt.lsp:
Warning: Free reference to undeclared variable 
%TRANSFER-PROPERTIES-DEFAULTS%
         assumed special.
; While compiling (:TOP-LEVEL-FORM "mt.lsp" 347) in 
/home/bmw20/erg/lkb/mt.lsp:
Warning: Free reference to undeclared variable %TRANSFER-PROPERTIES-FILTER%
         assumed special.
; While compiling (:TOP-LEVEL-FORM "mt.lsp" 388) in 
/home/bmw20/erg/lkb/mt.lsp:
Warning: Free reference to undeclared variable %TRANSFER-VALUES-FILTER%
         assumed special.

Dan Flickinger wrote:
> As a follow-up to yesterday's message, note that a similar error (assigning
> NIL as the span for a token) arises with the ERG preprocessor when one
> token is replaced with another for the current cheap and cheerful spell 
> correction.  For example, 
> (lkb::preprocess "The chears arose.") 
> gives the span of the spell-corrected "cheers" as NIL.  But note that if the 
> misspelling is at the end of the input, the span is okay: 
> (lkb::preprocess "The chears.")
>
>   Dan
>
>   




More information about the developers mailing list