1
(* $Id: uCharTbl.mli,v 1.1 2003/12/19 17:24:34 yori Exp $ *)
2
(* Copyright 2002, 2003 Yamagata Yoriyuki. distributed with LGPL *)
4
(** Fast lookup tables. Accessible by constant time. *)
8
val get : 'a tbl -> UChar.t -> 'a
10
module type Type = sig
13
val get : elt tbl -> UChar.t -> elt
15
(** [of_map def m] creates the table which has the same value to [m].
16
The table returns [def] for the characters for which [m] is undefined. *)
17
val of_map : elt -> elt UMap.t -> t
20
(** Equality and hash are necessary for table generation. *)
22
functor (H : Hashtbl.HashedType) -> (Type with type elt = H.t)
24
(** Tables for boolean values. *)
27
val get : t -> UChar.t -> bool
28
val of_set : USet.t -> t
31
(** Tables for small (< 256, >=0) integers *)
34
val of_map : int -> int UMap.t -> t
35
val get : t -> UChar.t -> int
38
(** Tables for integers. If integers are not span the whole 31-bit or
39
63-bit values, [Bytes.t] is more space efficient than [int tbl]. *)
42
val of_map : int -> int UMap.t -> t
43
val get : t -> UChar.t -> int
46
(** Tables for bytes. *)
49
val of_map : char -> char UMap.t -> t
50
val get : t -> UChar.t -> char