Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 65acecdc authored by Bruno Guillaume's avatar Bruno Guillaume
Browse files

follow libgrew

parent 61ecc6b8
No related branches found
No related tags found
No related merge requests found
...@@ -166,17 +166,17 @@ let run_command request = ...@@ -166,17 +166,17 @@ let run_command request =
begin begin
try try
let corpus_index = json |> member "corpus_index" |> to_int in let corpus_index = json |> member "corpus_index" |> to_int in
let pattern = Grs.request_of_json ~config (json |> member "request") in let request = Request.of_json ~config (json |> member "request") in
let corpus = Global.corpus_get corpus_index in let corpus = Global.corpus_get corpus_index in
let matches = let matches =
Array.fold_left Array.fold_left
(fun acc (id,graph) -> (fun acc (id,graph) ->
let matching_list = Matching.search_pattern_in_graph ~config pattern graph in let matching_list = Matching.search_request_in_graph ~config request graph in
(List.map (List.map
(fun m -> `Assoc [ (fun m -> `Assoc [
("sent_id", `String id); ("sent_id", `String id);
("matching", Matching.to_json pattern graph m) ("matching", Matching.to_json request graph m)
] ]
) matching_list ) matching_list
) @ acc ) @ acc
...@@ -195,12 +195,12 @@ let run_command request = ...@@ -195,12 +195,12 @@ let run_command request =
begin begin
try try
let corpus_index = json |> member "corpus_index" |> to_int in let corpus_index = json |> member "corpus_index" |> to_int in
let pattern = Grs.request_of_json ~config (json |> member "request") in let request = Request.of_json ~config (json |> member "request") in
let corpus = Global.corpus_get corpus_index in let corpus = Global.corpus_get corpus_index in
let count = Array.fold_left let count = Array.fold_left
(fun acc (id,graph) -> (fun acc (id,graph) ->
let matching_list = Matching.search_pattern_in_graph ~config pattern graph in let matching_list = Matching.search_request_in_graph ~config request graph in
(List.length matching_list) + acc (List.length matching_list) + acc
) 0 corpus in ) 0 corpus in
Yojson.Basic.to_string Yojson.Basic.to_string
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment