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 (* Only valid if compiled with -DTRACE *)
18 let trace_file = ref "trace.dot"
21 let set_index_type = function
22 | "default" -> text_index_type := 0
23 | "swcsa" -> text_index_type := 1
24 | "rlcsa" -> text_index_type := 2
25 | s -> raise (Arg.Bad(s))
27 let usage_msg = Printf.sprintf "%s [options] <input.{xml|srx}> 'query' [output]" Sys.argv.(0)
32 fun s -> match !pos with
33 | 0 -> input_file:= s;incr pos
34 | 1 -> query := s; incr pos
35 | 2 -> output_file := Some s; incr pos
36 | _ -> raise (Arg.Bad(s))
39 [ "-c", Arg.Set(count_only),
40 " counting only (don't materialize the result set)";
42 "-f", Arg.Set_int(sample_factor),
43 "<n> sample factor [default=64]";
45 "-i", Arg.Set(index_empty_texts),
46 " index empty texts [default=false]";
48 "-d", Arg.Set(disable_text_collection),
49 " disable text collection[default=false]";
51 "-s", Arg.Set_string(save_file),
52 "<save_file> save the intermediate representation into file.srx";
54 "-b", Arg.Set(bottom_up), " real bottom up run";
56 "-nj", Arg.Set(no_jump), " disable jumping";
58 "-index-type", Arg.Symbol ([ "default"; "swcsa"; "rlcsa" ],
60 " choose text index type";
62 "-v", Arg.Set(verbose), " verbose mode"; ] @
65 "-trace-file", Arg.Set_string(trace_file),
66 "<trace_file> save the full trace in dot format in <trace_file>"
73 let _ = Arg.parse spec anon_fun usage_msg
75 if (!pos > 3 || !pos < 2)
76 then begin Arg.usage spec usage_msg; exit 1 end