1
(************************************************************************)
2
(* v * The Coq Proof Assistant / The Coq Development Team *)
3
(* <O___,, * CNRS-Ecole Polytechnique-INRIA Futurs-Universite Paris Sud *)
4
(* \VV/ **************************************************************)
5
(* // * This file is distributed under the terms of the *)
6
(* * GNU Lesser General Public License Version 2.1 *)
7
(************************************************************************)
9
(*i $Id: alpha.ml 5920 2004-07-16 20:01:26Z herbelin $ i*)
11
let norm_char c = match Char.uppercase c with
12
| '\192'..'\198' -> 'A'
14
| '\200'..'\203' -> 'E'
15
| '\204'..'\207' -> 'I'
17
| '\210'..'\214' -> 'O'
18
| '\217'..'\220' -> 'U'
23
let u = String.copy s in
24
for i = 0 to String.length s - 1 do
25
u.[i] <- norm_char s.[i]
29
let compare_char c1 c2 = match norm_char c1, norm_char c2 with
30
| ('A'..'Z' as c1), ('A'..'Z' as c2) -> compare c1 c2
33
| c1, c2 -> compare c1 c2
35
let compare_string s1 s2 =
36
let n1 = String.length s1 in
37
let n2 = String.length s2 in
39
if i == n1 || i == n2 then
42
let c = compare_char s1.[i] s2.[i] in
43
if c == 0 then cmp (succ i) else c