Mentions légales du service

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

remote deprecated functions

parent 6a0c25a7
Branches
No related tags found
No related merge requests found
...@@ -47,7 +47,7 @@ let run_command request = ...@@ -47,7 +47,7 @@ let run_command request =
end end
(* ======================= load_graph ======================= *) (* ======================= load_graph ======================= *)
| Some "load_graph" -> (* | Some "load_graph" ->
begin begin
match json |> member "filename" |> to_string_option with match json |> member "filename" |> to_string_option with
| Some filename -> | Some filename ->
...@@ -55,10 +55,10 @@ let run_command request = ...@@ -55,10 +55,10 @@ let run_command request =
let data = Graph.to_json graph in let data = Graph.to_json graph in
Yojson.Basic.to_string (`Assoc [("status", `String "OK"); ("data", data)]) Yojson.Basic.to_string (`Assoc [("status", `String "OK"); ("data", data)])
| None -> json_error "no 'filename' in 'load_graph' command" | None -> json_error "no 'filename' in 'load_graph' command"
end end *)
(* ======================= save_graph ======================= *) (* ======================= save_graph ======================= *)
| Some "save_graph" -> (* | Some "save_graph" ->
begin begin
match ( match (
json |> member "graph" |> to_string_option, json |> member "graph" |> to_string_option,
...@@ -69,7 +69,7 @@ let run_command request = ...@@ -69,7 +69,7 @@ let run_command request =
Yojson.Basic.to_file filename (Graph.to_json gr); Yojson.Basic.to_file filename (Graph.to_json gr);
Yojson.Basic.to_string (`Assoc [("status", `String "OK"); ("data", `Null)]) Yojson.Basic.to_string (`Assoc [("status", `String "OK"); ("data", `Null)])
| _ -> json_error "incomplete 'save_graph' command" | _ -> json_error "incomplete 'save_graph' command"
end end *)
(* ======================= load_grs ======================= *) (* ======================= load_grs ======================= *)
| Some "load_grs" -> | Some "load_grs" ->
...@@ -141,14 +141,14 @@ let run_command request = ...@@ -141,14 +141,14 @@ let run_command request =
end end
(* ======================= corpus_size ======================= *) (* ======================= corpus_size ======================= *)
| Some "corpus_size" -> (* | Some "corpus_size" ->
begin begin
try try
let corpus = json |> member "corpus_index" |> to_int |> Global.corpus_get in let corpus = json |> member "corpus_index" |> to_int |> Global.corpus_get in
Yojson.Basic.to_string (`Assoc [("status", `String "OK"); ("data", `Int (Array.length corpus))]) Yojson.Basic.to_string (`Assoc [("status", `String "OK"); ("data", `Int (Array.length corpus))])
with with
| Error msg -> json_error msg | Error msg -> json_error msg
end end *)
(* ======================= corpus_sent_ids ======================= *) (* ======================= corpus_sent_ids ======================= *)
| Some "corpus_sent_ids" -> | Some "corpus_sent_ids" ->
...@@ -209,22 +209,6 @@ let run_command request = ...@@ -209,22 +209,6 @@ let run_command request =
| Error msg -> json_error msg | Error msg -> json_error msg
end end
(* ======================= search ======================= *)
| Some "search" ->
begin
match (
json |> member "graph" |> to_string_option,
json |> member "pattern" |> to_string_option
) with
| Some graph, Some string_pattern ->
let gr = Graph.of_json (Yojson.Basic.from_string graph) in
let pattern = Pattern.parse ~config string_pattern in
let matching_list = Matching.search_pattern_in_graph ~config pattern gr in
let json_list = List.map (fun m -> Matching.to_json pattern gr m) matching_list in
Yojson.Basic.to_string (`Assoc [("status", `String "OK"); ("data", `List (json_list))])
| _ -> json_error "incomplete 'search' command"
end
(* ======================= run ======================= *) (* ======================= run ======================= *)
| Some "run" -> | Some "run" ->
begin begin
...@@ -279,7 +263,7 @@ let run_command request = ...@@ -279,7 +263,7 @@ let run_command request =
end end
(* ======================= dot_graph ======================= *) (* ======================= dot_graph ======================= *)
| Some "dot_to_png" -> (* | Some "dot_to_png" ->
begin begin
match json |> member "graph" |> to_string_option with match json |> member "graph" |> to_string_option with
| Some graph -> | Some graph ->
...@@ -292,10 +276,10 @@ let run_command request = ...@@ -292,10 +276,10 @@ let run_command request =
("data", `String png_file) ("data", `String png_file)
]) ])
| _ -> json_error "incomplete 'dot_graph' command" | _ -> json_error "incomplete 'dot_graph' command"
end end *)
(* ======================= dot_graph ======================= *) (* ======================= dot_graph ======================= *)
| Some "dep_to_png" -> (* | Some "dep_to_png" ->
begin begin
match json |> member "graph" |> to_string_option with match json |> member "graph" |> to_string_option with
| Some graph -> | Some graph ->
...@@ -308,10 +292,10 @@ let run_command request = ...@@ -308,10 +292,10 @@ let run_command request =
("data", `String png_file) ("data", `String png_file)
]) ])
| _ -> json_error "incomplete 'dep_graph' command" | _ -> json_error "incomplete 'dep_graph' command"
end end *)
(* ======================= graph_svg ======================= *) (* ======================= graph_svg ======================= *)
| Some "dep_to_svg" -> (* | Some "dep_to_svg" ->
begin begin
match json |> member "graph" |> to_string_option with match json |> member "graph" |> to_string_option with
| Some graph -> | Some graph ->
...@@ -323,7 +307,7 @@ let run_command request = ...@@ -323,7 +307,7 @@ let run_command request =
("data", `String svg_file) ("data", `String svg_file)
]) ])
| _ -> json_error "incomplete 'graph_svg' command" | _ -> json_error "incomplete 'graph_svg' command"
end end *)
| Some command -> json_error (sprintf "command '%s' not found" command) | Some command -> json_error (sprintf "command '%s' not found" command)
with with
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment