/[mldonkey]/mldonkey/src/utils/lib/indexer1.ml
ViewVC logotype

Diff of /mldonkey/src/utils/lib/indexer1.ml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by mldonkey, Thu Jul 29 10:25:34 2004 UTC revision 1.3 by spiralvoice, Thu Jul 7 00:25:46 2005 UTC
# Line 245  le mot apparait. Line 245  le mot apparait.
245          end          end
246            
247      let print idx =      let print idx =
248        lprintf "INDEX"; lprint_newline ();          lprintf_nl "INDEX";
249        let rec iter pos tree =        let rec iter pos tree =
250          match tree.tree_expr with          match tree.tree_expr with
251          | Suffix s ->          | Suffix s ->
252              spaces pos;              spaces pos;
253              lprintf "SUFFIX %d" s.suffix_num; lprint_newline ();              lprintf_nl "SUFFIX %d" s.suffix_num;
254          | String (s, num) ->          | String (s, num) ->
255              spaces pos;              spaces pos;
256              lprintf "[%s]  ---> [%d]" s num.suffix_num;                lprintf "[%s]  ---> [%d]" s num.suffix_num;
257              spaces pos;              spaces pos;
258              lprintf "  ";              lprintf "  ";
259              List.iter (fun w ->              List.iter (fun w ->
260                  lprintf "%s " w.word_string) num.suffix_words;                  lprintf_nl "%s " w.word_string) num.suffix_words;
             lprint_newline ();  
261          | List(num, list) ->          | List(num, list) ->
262              spaces pos;              spaces pos;
263              lprintf "List [%d]" num.suffix_num; lprint_newline ();              lprintf_nl "List [%d]" num.suffix_num;
264              List.iter (fun (c, tree) ->              List.iter (fun (c, tree) ->
265                  spaces (pos+2);                  spaces (pos+2);
266                  lprintf "Char [%c]" c; lprint_newline ();                  lprintf_nl "Char [%c]" c;
267                  iter (pos+4) tree                  iter (pos+4) tree
268              ) list;              ) list;
269          | Filtered tree ->          | Filtered tree ->
270              lprintf "FILTERED"; lprint_newline ();              lprintf_nl "FILTERED";
271              iter (pos+2) tree              iter (pos+2) tree
272        in        in
273        iter 0 idx.index_tree        iter 0 idx.index_tree
# Line 281  le mot apparait. Line 280  le mot apparait.
280        }        }
281            
282      let print_word_docs w =      let print_word_docs w =
283        lprintf "Word [%s]" w.word_string; lprint_newline ();        lprintf_nl "Word [%s]" w.word_string;
284        List.iter (fun (doc, _) ->        List.iter (fun (doc, _) ->
285            lprintf "    %d" (Doc.num doc); lprint_newline ()) w.word_docs;            lprintf_nl "    %d" (Doc.num doc)) w.word_docs
       lprint_newline ()  
286            
287      let rec print_suffix_docs suffix =      let rec print_suffix_docs suffix =
288        List.iter (fun w ->        List.iter (fun w ->
# Line 301  le mot apparait. Line 299  le mot apparait.
299            print_suffix_docs s;            print_suffix_docs s;
300            List.iter (fun (c,t) -> print_all_docs t.tree_expr) list            List.iter (fun (c,t) -> print_all_docs t.tree_expr) list
301        | Filtered t ->        | Filtered t ->
302            lprintf "filtered"; lprint_newline ();            lprintf_nl "filtered";
303            print_all_docs t.tree_expr            print_all_docs t.tree_expr
304    
305    
# Line 336  le mot apparait. Line 334  le mot apparait.
334            None -> s.suffix_words | Some w -> w :: s.suffix_words)            None -> s.suffix_words | Some w -> w :: s.suffix_words)
335            
336      let add_filter idx s =      let add_filter idx s =
337  (*  lprintf "ADD FILETRR ON %s" s; lprint_newline (); *)  (*  lprintf "ADD FILTER ON %s" s; lprint_newline (); *)
338        let len = String.length s in        let len = String.length s in
339        let rec iter pos tree =        let rec iter pos tree =
340          if pos = len then begin          if pos = len then begin
# Line 504  lprint_newline (); Line 502  lprint_newline ();
502    end    end
503        
504        
 module FullMake (Doc : Indexer.Doc) = Indexer.FullMake (Doc ) (Make)  
505    module FullMake (Doc : Indexer.Doc) = Indexer.FullMake (Doc ) (Make)

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26