Mentions légales du service

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

add conll_graph function

parent 3948ef84
Branches
No related tags found
No related merge requests found
......@@ -260,6 +260,25 @@ let run_command request =
| _ -> json_error "incomplete 'json_grs' command"
end
(* ======================= conll_graph ======================= *)
| Some "conll_graph" ->
begin
match json |> member "graph" |> to_string_option with
| Some graph ->
let conll_string =
graph
|> Yojson.Basic.from_string
|> (fun x -> printf "==========================\n%s\n======================\n%!" (Yojson.Basic.pretty_to_string x); x)
|> Conllx.of_json
|> Conllx.to_string ~config in
Yojson.Basic.to_string
(`Assoc [
("status", `String "OK");
("data", `String conll_string)
])
| _ -> json_error "cannot execute `conll_graph' command"
end
(* ======================= dot_graph ======================= *)
| Some "dot_to_png" ->
begin
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment