From e289283447fac165757b37f7e145cf51ebda17b1 Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Sun, 13 Jun 2004 16:57:40 +0000 Subject: Updated git-svn-id: file:///home/puszcza/svnroot/ellinika/trunk@122 941c8c0f-9102-463b-b60b-cd22ce0e6858 --- scm/xlat.scm | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'scm/xlat.scm') diff --git a/scm/xlat.scm b/scm/xlat.scm index 7548e54..37028b3 100644 --- a/scm/xlat.scm +++ b/scm/xlat.scm @@ -101,7 +101,7 @@ (cons "Ϋ" #\Y ) (cons "ΰ" (cons #\Y #t)))) -(define (greek->xlat0 str) +(define-public (greek->xlat0 str) "Convert the greek STRing into its latin transliteration. Returns (list AP XLAT) @@ -116,9 +116,8 @@ Secondary accents are ignored" (lcnt 0 (1+ lcnt)) (sl '())) ((= i len) (cons - (if accent-pos - (- (length sl) accent-pos 1) - 0) + (and accent-pos + (- (length sl) accent-pos 1)) (reverse sl))) (letrec ((get-trans (lambda (x) (let ((y (cdr x))) @@ -225,7 +224,7 @@ Secondary accents are ignored" (set! wl (cdr wl)) (set! syl (cons a syl)) (cond - ((= ap (length wl)) + ((and ap (= ap (length wl))) (set! accented (length sl))) (else (case a @@ -235,7 +234,7 @@ Secondary accents are ignored" (or (char=? (car wl) #\i) (char=? (car wl) #\y))) (set! syl (cons (car wl) syl)) (set! wl (cdr wl)) - (if (= ap (length wl)) + (if (and ap (= ap (length wl))) (set! accented (length sl)))))) ((#\i) (if (not (null? wl)) @@ -244,19 +243,19 @@ Secondary accents are ignored" (char=? (car wl) #\a)) (set! syl (cons (car wl) syl)) (set! wl (cdr wl)) - (if (= ap (length wl)) + (if (and ap (= ap (length wl))) (set! accented (length sl)))) ((char=? (car wl) #\o) ;; "ιο" ή "ιου" (set! syl (cons (car wl) syl)) (set! wl (cdr wl)) (cond - ((= ap (length wl)) + ((and ap (= ap (length wl))) (set! accented (length sl))) ((and (not (null? wl)) (char=? (car wl) #\y)) (set! syl (cons (car wl) syl)) (set! wl (cdr wl)) - (if (= ap (length wl)) + (if (and ap (= ap (length wl))) (set! accented (length sl))))))))) ((#\y) (cond @@ -264,7 +263,7 @@ Secondary accents are ignored" (char=? (car wl) #\i)) (set! syl (cons (car wl) syl)) (set! wl (cdr wl)) - (if (= ap (length wl)) + (if (and ap (= ap (length wl))) (set! accented (length sl)))))) ((#\Y #\I) (set! accented (length sl)))))) @@ -273,9 +272,9 @@ Secondary accents are ignored" (define-public (greek->xlat str) (let* ((wl (greek->xlat0 str)) - (sl (prosodia (car wl) (cdr wl) 0 '()))) + (sl (prosodia (car wl) (cdr wl) #f '()))) (cons - (- (length (cdr sl)) (car sl)) + (and (car sl) (- (length (cdr sl)) (car sl))) (cdr sl)))) ;;;; End of file \ No newline at end of file -- cgit v1.2.1