Changeset 22226 in project


Ignore:
Timestamp:
01/04/11 18:11:39 (9 years ago)
Author:
Alan Post
Message:

jbogenturfa'i: .i cipra zo'e lo ro gismu

Insert all gismu into the database and run the list through the
parser, making sure they are all recognized as gismu.

Location:
release/4/jbogenturfahi/trunk
Files:
1 added
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • release/4/jbogenturfahi/trunk/chicken-db.scm

    r22199 r22226  
    33(use genturfahi)
    44(use genturfahi-peg)
     5(use data-structures)
    56(use sqlite3)
    67
     
    89; directory until we've created it.
    910;
    10 (define jbogenturfahi-db-path (make-parameter "jbogenturfahi.db"))
     11(define jbogenturfahi-db-file (make-parameter "jbogenturfahi.db"))
    1112
    1213(include "c0re.scm")
     
    1516
    1617(include "wordlists/cmavo.scm")
     18(include "wordlists/gismu.scm")
  • release/4/jbogenturfahi/trunk/chicken-ext.scm

    r22211 r22226  
    3232   cmavo:gen-select-list
    3333   
     34   gismu:drop-table
     35   gismu:create-table
     36   gismu:gen-insert
     37   gismu:gen-select-list
     38   
    3439   jbogenturfahi-db
    35    jbogenturfahi-db-path)
     40   jbogenturfahi-db-file)
    3641
    3742(import chicken)
  • release/4/jbogenturfahi/trunk/db.scm

    r22198 r22226  
    1818;;;;
    1919
    20 (define jbogenturfahi-db (sql:open (jbogenturfahi-db-path)))
     20(define jbogenturfahi-db (sql:open (jbogenturfahi-db-file)))
    2121
    2222(define (cmavo:drop-table)
    2323  (sql:drop-table jbogenturfahi-db #<<EOS
    2424drop table if exists cmavo;
     25EOS
     26))
     27
     28(define (gismu:drop-table)
     29  (sql:drop-table jbogenturfahi-db #<<EOS
     30drop table if exists gismu;
    2531EOS
    2632))
     
    3541))
    3642
     43(define (gismu:create-table)
     44  (sql:create-table jbogenturfahi-db #<<EOS
     45create table if not exists
     46gismu(valsi varchar(5) primary key);
     47EOS
     48))
     49
    3750(define (cmavo:gen-insert)
    3851  (sql:gen-insert jbogenturfahi-db #<<EOS
    3952insert into cmavo('valsi', 'selmaho', 'series')
    4053values(?, ?, ?);
     54EOS
     55))
     56
     57(define (gismu:gen-insert)
     58  (sql:gen-insert jbogenturfahi-db #<<EOS
     59insert into gismu('valsi')
     60values(?);
    4161EOS
    4262))
     
    5070EOS
    5171))
     72
     73(define (gismu:gen-select-list)
     74  (sql:gen-select-list jbogenturfahi-db #<<EOS
     75select   valsi
     76from     gismu
     77order by valsi
     78EOS
     79))
  • release/4/jbogenturfahi/trunk/jbogenturfahi.meta

    r22194 r22226  
    2323 (license "ISC")
    2424 (needs genturfahi sqlite3 srfi-14 utils)
    25  (test-depends matchable srfi-13 test)
     25 (test-depends data-structures matchable srfi-13 test)
    2626 (synopsis "lo lojbo ke pe'a jajgau ratcu ke'e genturfa'i"))
  • release/4/jbogenturfahi/trunk/jbogenturfahi.setup

    r22204 r22226  
    2121(use genturfahi-peg)
    2222(use extras)
    23 (use srfi-1)
    2423
    2524(include "version.scm")
    2625(include "chicken-conf.scm")
    2726
    28 (define jbogenturfahi-db-path
    29         (reduce make-pathname
    30                 "/"
    31                 `(,jbogenturfahi-version
    32                   "jbogenturfahi"
    33                   ,(chicken-home))))
    34 (define jbogenturfahi-db-file
    35         (make-pathname jbogenturfahi-db-path "jbogenturfahi.db"))
     27(define db-path
     28        (make-pathname `(,(chicken-home) "jbogenturfahi")
     29                         jbogenturfahi-version))
     30(define db-file
     31        (make-pathname db-path "jbogenturfahi.db"))
    3632
    3733       ; jbogenturfahi executable
     
    163159                            "db.scm"
    164160                            "wordlists/cmavo.scm"
     161                            "wordlists/gismu.scm"
    165162                            "wordlists/cmavo.txt"
    166163                            "wordlists/gismu.txt"
     
    174171         (call-with-output-file "path.scm"
    175172           (lambda (port)
    176              (write `(define jbogenturfahi-db-path
    177                              (make-parameter ,jbogenturfahi-db-file))
     173             (write `(define jbogenturfahi-db-file
     174                             (make-parameter ,db-file))
    178175                    port))))
    179176
     
    254251  (exit))
    255252
    256 (create-directory/parents jbogenturfahi-db-path)
    257 (copy-file "jbogenturfahi.db" jbogenturfahi-db-path)
     253(create-directory/parents db-path)
     254(copy-file "jbogenturfahi.db" db-path)
  • release/4/jbogenturfahi/trunk/tests/gismu.scm

    r22218 r22226  
    1818;;;;
    1919
    20 (use jbogenturfahi matchable test)
     20(define (test-gismu gismu)
     21         ; parse this gismu
     22         ;
     23  (let* ((gerna (jbogenturfahi-rafske gismu))
     24         (class (caar gerna))
     25         (valsi (cadar gerna)))
     26    (test #t (eq?      'gismu class))
     27    (test #t (string=? gismu  valsi))))
    2128
    22 (include "../c0re.scm")
    23 (include "cmavo.scm")
     29(define (gismu)
     30  (let ((rodagismu (gismu:gen-select-list)))
     31    (map (compose test-gismu car) (rodagismu)))
     32  0)
    2433
    25 (test-exit)
     34(test-group "gismu"
     35  (gismu))
  • release/4/jbogenturfahi/trunk/tests/run.scm

    r22201 r22226  
    2222(include "../c0re.scm")
    2323(include "cmavo.scm")
     24(include "gismu.scm")
    2425
    2526(test-exit)
Note: See TracChangeset for help on using the changeset viewer.