aboutsummaryrefslogtreecommitdiff
path: root/scm/xlat.scm
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2004-06-13 16:57:40 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2004-06-13 16:57:40 +0000
commite289283447fac165757b37f7e145cf51ebda17b1 (patch)
tree3801b3401eccca922a8f8ed11374353078856ab4 /scm/xlat.scm
parent5b20207a0069dec883a3f8d721efc5d86b32abeb (diff)
downloadellinika-e289283447fac165757b37f7e145cf51ebda17b1.tar.gz
ellinika-e289283447fac165757b37f7e145cf51ebda17b1.tar.bz2
Updated
git-svn-id: file:///home/puszcza/svnroot/ellinika/trunk@122 941c8c0f-9102-463b-b60b-cd22ce0e6858
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.