File: database.mli

package info (click to toggle)
spamoracle 1.4-8
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 248 kB
  • ctags: 243
  • sloc: ml: 1,198; makefile: 138; sh: 74
file content (39 lines) | stat: -rw-r--r-- 1,464 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
(***********************************************************************)
(*                                                                     *)
(*                 SpamOracle -- a Bayesian spam filter                *)
(*                                                                     *)
(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
(*                                                                     *)
(*  Copyright 2002 Institut National de Recherche en Informatique et   *)
(*  en Automatique.  This file is distributed under the terms of the   *)
(*  GNU Public License version 2, http://www.gnu.org/licenses/gpl.txt  *)
(*                                                                     *)
(***********************************************************************)

(* $Id: database.mli,v 1.4 2003/05/25 08:42:52 xleroy Exp $ *)

(** Word frequency database *)

type short = {
  s_num_good: int;
  s_num_spam: int;
  s_freq: (string, int * int) Hashtbl.t
}

type full = {
  mutable f_num_good: int;
  mutable f_num_spam: int;
  f_high_freq: (string, int * int) Hashtbl.t;
  f_low_freq: (string, int * int) Hashtbl.t
}

val read_short: string -> short
val read_full: string -> full
val write_full: string -> full -> unit
val create: int -> full
val add_good: full -> string -> unit
val add_spam: full -> string -> unit
val dump: full -> out_channel -> unit
val restore: in_channel -> full

exception Error of string