~ubuntu-branches/ubuntu/lucid/camomile/lucid

« back to all changes in this revision

Viewing changes to public/uCharTbl.mli

  • Committer: Bazaar Package Importer
  • Author(s): Sylvain Le Gall
  • Date: 2005-12-03 01:18:55 UTC
  • Revision ID: james.westby@ubuntu.com-20051203011855-qzvwlld1xyqnl62t
Tags: upstream-0.6.3
ImportĀ upstreamĀ versionĀ 0.6.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
(* $Id: uCharTbl.mli,v 1.1 2003/12/19 17:24:34 yori Exp $ *)
 
2
(* Copyright 2002, 2003 Yamagata Yoriyuki. distributed with LGPL *)
 
3
 
 
4
(** Fast lookup tables.  Accessible by constant time. *)
 
5
  type 'a tbl
 
6
  type 'a t = 'a tbl
 
7
 
 
8
  val get : 'a tbl -> UChar.t -> 'a
 
9
 
 
10
  module type Type = sig
 
11
    type elt
 
12
    type t = elt tbl
 
13
    val get : elt tbl -> UChar.t -> elt
 
14
 
 
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
 
18
  end
 
19
 
 
20
(** Equality and hash are necessary for table generation. *)
 
21
  module Make : 
 
22
  functor (H : Hashtbl.HashedType) ->  (Type with type elt = H.t)
 
23
 
 
24
(** Tables for boolean values. *)
 
25
  module Bool : sig
 
26
    type t
 
27
    val get : t -> UChar.t -> bool
 
28
    val of_set : USet.t -> t
 
29
  end
 
30
 
 
31
(** Tables for small (< 256, >=0) integers *)
 
32
  module Bits : sig
 
33
    type t
 
34
    val of_map : int -> int UMap.t -> t
 
35
    val get : t -> UChar.t -> int
 
36
  end
 
37
 
 
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]. *)
 
40
  module Bytes : sig
 
41
    type t
 
42
    val of_map : int -> int UMap.t -> t
 
43
    val get : t -> UChar.t -> int
 
44
  end
 
45
 
 
46
(** Tables for bytes. *)
 
47
  module Char : sig
 
48
    type t
 
49
    val of_map : char -> char UMap.t -> t
 
50
    val get : t -> UChar.t -> char
 
51
  end