1 let index_empty_texts = ref false
2 let sample_factor = ref 64
3 let disable_text_collection = ref false
4 let tc_threshold = ref 60000
7 let input_file = ref ""
8 let output_file = ref None
10 let count_only = ref false
12 let bottom_up = ref false
13 let no_jump = ref false
14 let verbose = ref false
15 let text_index_type = ref 0
17 let set_index_type = function
18 | "default" -> text_index_type := 0
19 | "swcsa" -> text_index_type := 1
20 | "rlcsa" -> text_index_type := 2
21 | s -> raise (Arg.Bad(s))
23 let usage_msg = Printf.sprintf "%s <input.{xml|srx}> 'query' [output]" Sys.argv.(0)
28 fun s -> match !pos with
29 | 0 -> input_file:= s;incr pos
30 | 1 -> query := s; incr pos
31 | 2 -> output_file := Some s; incr pos
32 | _ -> raise (Arg.Bad(s))
34 let spec = [ "-c", Arg.Set(count_only),
35 " counting only (don't materialize the result set)";
36 (* "-t", Arg.Set(time), "print timing statistics";
37 "-max-tc", Arg.Set_int(tc_threshold),
38 "set maximum count for which the TextCollection is used";
40 "-f", Arg.Set_int(sample_factor),
41 "<n> sample factor [default=64]";
43 "-i", Arg.Set(index_empty_texts),
44 " index empty texts [default=false]";
45 "-d", Arg.Set(disable_text_collection),
46 " disable text collection[default=false]";
47 "-s", Arg.Set_string(save_file),
48 "<save_file> save the intermediate representation into file.srx";
49 "-b", Arg.Set(bottom_up), " real bottom up run";
50 "-nj", Arg.Set(no_jump), " disable jumping";
51 "-index-type", Arg.Symbol ([ "default"; "swcsa"; "rlcsa" ], set_index_type),
52 " choose text index type";
53 "-v", Arg.Set(verbose), " verbose mode";
57 let _ = Arg.parse spec anon_fun usage_msg
59 if (!pos > 3 || !pos < 2)
60 then begin Arg.usage spec usage_msg; exit 1 end