source: project/release/3/levenshtein/tags/1.7.0/levenshtein-utf8-means.scm @ 9819

Last change on this file since 9819 was 9819, checked in by Kon Lovett, 12 years ago

Rel 1.7.0

File size: 1.0 KB
Line 
1;;;; levenshtein-utf8-means.scm
2;;;; Kon Lovett, May '06
3
4(use syntax-case
5     procedure-surface levenshtein-sequence-surface
6     utf8 utf8-srfi-13)
7
8(eval-when (compile)
9  (declare
10    (fixnum)
11    (inline)
12    (no-procedure-checks)
13    (no-bound-checks)
14    (export
15      levenshtein-utf8-means ) ) )
16
17(declare-procedure-means levenshtein-utf8-means levenshtein-sequence-surface
18  #:immutable #t
19  sequence->vector          (o list->vector string->list)
20  sequence-length           string-length
21  sequence-prefix-length    (lambda (f s1 s2 . rest) (apply string-prefix-length s1 s2 rest))
22  sequence-suffix-length    (lambda (f s1 s2 . rest) (apply string-suffix-length s1 s2 rest))
23  ; Provides 'for-each' procedure with signature of 'vector-for-each'
24  sequence-for-each         (lambda (f s . rest)
25                              (let ([i 0])
26                                (apply string-for-each (lambda (c) (f i c) (set! i (fx+ i 1)))
27                                                       s rest) ) )
28  subsequence/shared        substring/shared )
Note: See TracBrowser for help on using the repository browser.