Time for an 2014 update…
This commit is contained in:
parent
372c577f83
commit
09687c4926
2520 changed files with 34227 additions and 7318 deletions
|
|
@ -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 []
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue