| Some n -> (*if n.link = None then*) n.link <- explicit
| None -> ()
-(* ------------
+(* ------------
suffix links
------------ *)
st
-let add (s: string) (seqar,root : t) =
- let k = DynArray.length seqar in
+let add (s: string) (seqar,root : t) =
+ let k = DynArray.length seqar in
DynArray.add seqar s;
let st = (seqar, root) in
let seq = s in
if !a < l
then raise Not_found
else implicit_node_aux (seqar,child) (subseq_sub implicit !a (w - !a))
- else (node,implicit,child)
+ else (node,implicit,child)
(*
let rec synthesized (seqar,root : t) (f : 'a list -> node -> 'a) =
-let contained_string gst word =
+let contained_string gst word =
List.map (fun (i,j) -> DynArray.get (fst gst) i) (exact_matches gst word)