summaryrefslogtreecommitdiff
path: root/src/nbc/storejudy.sml
diff options
context:
space:
mode:
Diffstat (limited to 'src/nbc/storejudy.sml')
-rw-r--r--src/nbc/storejudy.sml17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/nbc/storejudy.sml b/src/nbc/storejudy.sml
new file mode 100644
index 0000000..c6385be
--- /dev/null
+++ b/src/nbc/storejudy.sml
@@ -0,0 +1,17 @@
+signature STORE_JUDY = sig
+ type t
+ val load: (int * string) Sequence.t -> t
+ val get: t * string -> int option
+end
+
+structure StoreJudy :> STORE_JUDY = struct
+ type t = Judy.t
+ fun load e =
+ let
+ val j = Judy.create ()
+ in
+ Sequence.app (fn (count, nmer) => Judy.insert (j, nmer, count)) e
+ ; j
+ end
+ val get = Judy.get
+end