aboutsummaryrefslogtreecommitdiff
path: root/scm/xlat.scm
diff options
context:
space:
mode:
Diffstat (limited to 'scm/xlat.scm')
-rw-r--r--scm/xlat.scm23
1 files changed, 11 insertions, 12 deletions
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

Return to:

Send suggestions and report system problems to the System administrator.