@keywords: Notation3 Pre-Processor

Hi,

I've written an @keywords pre-processor that tokenizes whilst still
supporting both langcodes and buffered input:

    http://inamidst.com/n3p/n3pp.py
    - Notation3 Pre-Processor

I tested it by running it against the n3p test-suite; in its default
mode it simply spits out @keywords-less N3 with all keywords made
explicit using the "@" decorator. Hence the following:

    $ ./runtest ../n3proc.py input
    [...] Passes: 66; Failures: 0

    $ ./runtest -- ../n3pp.py input \| \
       ../n3proc.py --baseURI=input /dev/stdin
    [...] Passes: 66; Failures: 0

Sidenote: n3pp.py doesn't remove the @keywords declarations entirely, it
merely reduces them to "@keywords ." each time. That's so that
"@keywords . p q r ." won't get output as something that N3 processors
can't handle at the moment. Were pre-processing to become vogue, N3
processors could assume that barenames are always QNames, since they
always will be in normalized N3.

Thanks,

-- 
Sean B. Palmer, http://inamidst.com/sbp/

Received on Friday, 14 January 2005 11:53:01 UTC