Time for an 2014 update…

This commit is contained in:
Ingy döt Net 2014-01-17 05:32:22 +00:00
parent 372c577f83
commit 09687c4926
2520 changed files with 34227 additions and 7318 deletions

View file

@ -37,12 +37,11 @@ let combine words i inv_index =
let h = Hashtbl.create (List.length inv_index) in
List.iter (fun (w, from) -> Hashtbl.replace h w from) inv_index;
List.iter (fun w ->
if Hashtbl.mem h w
then begin
let from = Hashtbl.find h w in
Hashtbl.replace h w (i::from)
end else
Hashtbl.add h w [i]
let from =
try Hashtbl.find h w
except Not_found -> []
in
Hashtbl.replace h w (i::from)
) words;
Hashtbl.fold (fun w from acc -> (w, from) :: acc) h []