[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lojban] jbogenturfa'i grammar testing



I've just checked in my first batch of tests for jbogenturfa'i.
I have tests for the selma'o ZOI and CLL 19.10 (which covers ZOI):


http://bugs.call-cc.org/browser/release/4/jbogenturfahi/trunk/tests/selmaho/zoi.scm

http://bugs.call-cc.org/browser/release/4/jbogenturfahi/trunk/tests/cll/19/10.scm

Both of these files compare Lojban statements to the parse tree
generated by jbogenturfa'i.  I don't return the literal parse tree
generated by the grammar but rather an idealized one.  For example,
here is CLL example 19.10.1:

  text:

    zo si cu lojbo valsi

  jbogenturfa'i.  Note that the structure of the text is evident,
    and that the sentence has a defined selbri and x1 place:

    (text (paragraphs
            (paragraph
              (sentence
                (term (sumti (ZO-clause (cmavo (ZO "zo"))
                                        (cmavo (SI "si")))))
                (CU-clause (cmavo (CU "cu")))
                (selbri
                  (BRIVLA-clause (gismu "lojbo"))
                  (BRIVLA-clause (gismu "valsi")))))))


  camxes.  This is the default, camxes has flags that affect the
    way the parse tree is written:

    text
      sentence
      |- ZOPre
      |  |- CMAVO
      |  |     ZO: zo
      |  |- CMAVO
      |        SI: si
      |- CMAVO
      |     CU: cu
      |- selbri3
         |- BRIVLA
         |     gismu: lojbo
         |- BRIVLA
               gismu: valsi


  jbofi'e -x -b:

[ ( zo si            ) cu      << |  lojbo              valsi          | >> ] 
[ ( "erase word"     ) is/does << |  Lojbanic [type-of] being word(s)  | >> ] 
[ ( valsi1 (word(s)) )         <<  \                                  /  >> ] 
1 2                  2         3  4                                   4  3  1 

I have not developed enough test cases yet to consider the parse
tree I'm generating final, but the basic idea is there: generate
a parse tree where the logical structure can be programatically
manipulated and the productions generating the grammar can change
without affecting the logical parse tree.

My next step is to test the remaining selma'o and CLL sections.
While I do this, I plan on developing a comprehensive test suite
for the grammar and using it to optimize and simplify the PEG
grammar, with the goal of getting it sufficiently well tested
to become the official grammar.

-Alan
-- 
.i ko djuno fi le do sevzi

-- 
You received this message because you are subscribed to the Google Groups "lojban" group.
To post to this group, send email to lojban@googlegroups.com.
To unsubscribe from this group, send email to lojban+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/lojban?hl=en.