diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2011-06-15 17:30:48 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2011-06-15 17:30:48 +0300 |
commit | d688c9630db459ec13e5311adaee05e651b3789d (patch) | |
tree | 760cad87ebfec5b42344cbd635e90b12c9f2e2fa /src | |
parent | 516f479a1ddb3bb783a01e9ffb20ba051243ffd0 (diff) | |
download | ellinika-d688c9630db459ec13e5311adaee05e651b3789d.tar.gz ellinika-d688c9630db459ec13e5311adaee05e651b3789d.tar.bz2 |
Minor changes
* src/cgi-bin/conj.scm4: Mark unattested stems and verb classes.
* src/ellinika/conjugator.scm (conjugate): Fix empty conjugation
return.
* xml/pl/rhmata.xml: Update.
Diffstat (limited to 'src')
-rw-r--r-- | src/cgi-bin/conj.scm4 | 66 | ||||
-rw-r--r-- | src/ellinika/conjugator.scm | 2 |
2 files changed, 58 insertions, 10 deletions
diff --git a/src/cgi-bin/conj.scm4 b/src/cgi-bin/conj.scm4 index 253de1d..8fca3f0 100644 --- a/src/cgi-bin/conj.scm4 +++ b/src/cgi-bin/conj.scm4 @@ -85,7 +85,6 @@ ifelse(IFACE,[CGI],(cgi:init)) -(define (show-conjugation:tense verb voice mood tense) - - #t) -(define (table-header count tense-names) +(define unattested '()) ; List of unattested flags + +(define (table-header count tenses) (display "\ @@ -96,4 +95,26 @@ ifelse(IFACE,[CGI],(cgi:init)) (lambda (tense) - (format #t "<th>~A</th>~%" tense)) - tense-names) + (let ((tense-name (car tense)) + (att (fold + (lambda (conj prev) + (let ((att (conjugation:attested conj))) + (if att + (append att prev) + prev))) + '() + (cdr tense)))) + (display "<th>") + (cond + ((not (member 'class att)) + (display "<a href=\"#class-na\">*</a> ") + (if (not (member 'class unattested)) + (set! unattested (cons 'class unattested))))) + (cond + ((not (member 'root att)) + (display "<a href=\"#root-na\">?</a> ") + (if (not (member 'root unattested)) + (set! unattested (cons 'root unattested))))) + (display tense-name) + (display "</th>") + (newline))) + tenses) (display "</tr></thead>")) @@ -104,2 +125,3 @@ ifelse(IFACE,[CGI],(cgi:init)) (define (transpose mtx) + (display "<!--\n")(write mtx)(display "\n-->") (let* ((w (length (car mtx))) @@ -165,3 +187,3 @@ ifelse(IFACE,[CGI],(cgi:init)) (let ((tenses (list-head tense-list count))) - (table-header count (map car tenses)) + (table-header count tenses) (format-tenses count (map cdr tenses) voice mood) @@ -239,3 +261,9 @@ ifelse(IFACE,[CGI],(cgi:init)) (error-message "OTHER ERROR: ~S ~S" key args)))))) - + +(define (show-conjugation-simple verb) + (for-each + (lambda (voice) + (show-conjugation:voice voice)) + (conjugate-all verb))) + (define (do-conj) @@ -245,2 +273,20 @@ ifelse(IFACE,[CGI],(cgi:init)) +(define (print-footnote id sign text) + (format #t "<p><a name=\"~A\">~A</a> ~A</p>~%" + id sign text)) + +(define (footnotes) + (display "<div class=\"footnote\">") + (for-each + (lambda (flag) + (case flag + ((class) + (print-footnote "class-na" "*" + "Conjugation class of this verb is not attested")) + ((root) + (print-footnote "root-na" "?" + "Stem of this verb is not attested")))) + unattested) + (display "</div>")) + (define (conj-html) @@ -266,3 +312,5 @@ ifelse(IFACE,[CGI],(cgi:init)) (main-form) - (do-conj)))))) + (do-conj) + (if (not (null? unattested)) + (footnotes))))))) diff --git a/src/ellinika/conjugator.scm b/src/ellinika/conjugator.scm index 8172686..069d641 100644 --- a/src/ellinika/conjugator.scm +++ b/src/ellinika/conjugator.scm @@ -463,3 +463,3 @@ AND i.tense=\"~A\" AND i.ident=f.ident" (if (not conj-list) - (list (list #f #f #f #f #f #f) #f #f) + (list (list #f #f #f #f #f #f #f #f)) (map car |