X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=src%2Ftree.ml;h=0c62ec741bfb4bbf1f0da6e6ed991feeee353430;hb=798507d52a5c11a6d852740056464241538fe76a;hp=f73e347e041919c780b55fd5edccc9068b1004ab;hpb=ee7298a574db84779df164b8a4d1794fe6345e98;p=SXSI%2Fxpathcomp.git diff --git a/src/tree.ml b/src/tree.ml index f73e347..0c62ec7 100644 --- a/src/tree.ml +++ b/src/tree.ml @@ -81,7 +81,7 @@ struct let do_text b t = if Buffer.length t > 0 then begin let s = Buffer.contents t in - if (!Options.index_empty_texts) || not (is_whitespace s) then + if (!Config.index_empty_texts) || not (is_whitespace s) then begin open_tag b "<$>"; text b s; @@ -123,17 +123,17 @@ struct let finalize () = do_text build buf; close_tag build ""; - Logger.print Format.err_formatter "Finished parsing@\n"; - Logger.print Format.err_formatter "Starting index construction@\n"; + LOG ( __ "parsing" 2 "%s\n" "Finished parsing"); + LOG ( __ "indexing" 2 "%s\n" "Starting index construction"); let r = close_document build in - Logger.print Format.err_formatter "Finished index construction@\n"; + LOG ( __ "indexing" 2 "%s\n" "Finished index construction"); r in Expat.set_start_element_handler parser_ (start_element_handler parser_ build buf); Expat.set_end_element_handler parser_ (end_element_handler parser_ build buf); Expat.set_character_data_handler parser_ (character_data_handler parser_ build buf); - Logger.print Format.err_formatter "Started parsing@\n"; - open_document build !Options.sample_factor !Options.disable_text_collection !Options.text_index_type; + LOG ( __ "parsing" 2 "%s\n" "Started parsing"); + open_document build !Config.sample_factor !Config.disable_text_collection !Config.text_index_type; open_tag build ""; parser_, finalize @@ -540,9 +540,9 @@ let is_node t = t != nil let is_root t = t == root let node_of_t t = - Logger.print err_formatter "Initializing tag structure@\n"; + LOG ( __ "indexing" 2 "%s\n" "Initializing tag structure"); let _ = Tag.init (mk_tag_ops t) in - Logger.print err_formatter "Starting tag table construction@\n"; + LOG ( __ "indexing" 2 "%s\n" "Starting tag table construction"); let f, n, c, d = time collect_labels t ~msg:"Building tag relationship table" in let c = Array.map TagS.to_ptset c in let n = Array.map TagS.to_ptset n in @@ -804,11 +804,6 @@ Largest tag id: %i@\n@?" (Ptset.Int.cardinal alltags) (Ptset.Int.max_elt alltags) -(* - Logger.print err_formatter "Average depth: %f, number of leaves %i@\n@?" ((float_of_int a)/. (float_of_int b)) b -;; - -*) type tree_pointer = tree let get_tree_pointer x = x.doc