Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
python
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
GitLab upgrade completed. Current version is 17.11.3.
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
grew
python
Commits
61ecc6b8
Commit
61ecc6b8
authored
2 years ago
by
Bruno Guillaume
Browse files
Options
Downloads
Patches
Plain Diff
remote deprecated functions
parent
6a0c25a7
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src_ocaml/grewpy.ml
+12
-28
12 additions, 28 deletions
src_ocaml/grewpy.ml
with
12 additions
and
28 deletions
src_ocaml/grewpy.ml
+
12
−
28
View file @
61ecc6b8
...
...
@@ -47,7 +47,7 @@ let run_command request =
end
(* ======================= load_graph ======================= *)
|
Some
"load_graph"
->
(*
| Some "load_graph" ->
begin
match json |> member "filename" |> to_string_option with
| Some filename ->
...
...
@@ -55,10 +55,10 @@ let run_command request =
let data = Graph.to_json graph in
Yojson.Basic.to_string (`Assoc [("status", `String "OK"); ("data", data)])
| None -> json_error "no 'filename' in 'load_graph' command"
end
end
*)
(* ======================= save_graph ======================= *)
|
Some
"save_graph"
->
(*
| Some "save_graph" ->
begin
match (
json |> member "graph" |> to_string_option,
...
...
@@ -69,7 +69,7 @@ let run_command request =
Yojson.Basic.to_file filename (Graph.to_json gr);
Yojson.Basic.to_string (`Assoc [("status", `String "OK"); ("data", `Null)])
| _ -> json_error "incomplete 'save_graph' command"
end
end
*)
(* ======================= load_grs ======================= *)
|
Some
"load_grs"
->
...
...
@@ -141,14 +141,14 @@ let run_command request =
end
(* ======================= corpus_size ======================= *)
|
Some
"corpus_size"
->
(*
| Some "corpus_size" ->
begin
try
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))])
with
| Error msg -> json_error msg
end
end
*)
(* ======================= corpus_sent_ids ======================= *)
|
Some
"corpus_sent_ids"
->
...
...
@@ -209,22 +209,6 @@ let run_command request =
|
Error
msg
->
json_error
msg
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 ======================= *)
|
Some
"run"
->
begin
...
...
@@ -279,7 +263,7 @@ let run_command request =
end
(* ======================= dot_graph ======================= *)
|
Some
"dot_to_png"
->
(*
| Some "dot_to_png" ->
begin
match json |> member "graph" |> to_string_option with
| Some graph ->
...
...
@@ -292,10 +276,10 @@ let run_command request =
("data", `String png_file)
])
| _ -> json_error "incomplete 'dot_graph' command"
end
end
*)
(* ======================= dot_graph ======================= *)
|
Some
"dep_to_png"
->
(*
| Some "dep_to_png" ->
begin
match json |> member "graph" |> to_string_option with
| Some graph ->
...
...
@@ -308,10 +292,10 @@ let run_command request =
("data", `String png_file)
])
| _ -> json_error "incomplete 'dep_graph' command"
end
end
*)
(* ======================= graph_svg ======================= *)
|
Some
"dep_to_svg"
->
(*
| Some "dep_to_svg" ->
begin
match json |> member "graph" |> to_string_option with
| Some graph ->
...
...
@@ -323,7 +307,7 @@ let run_command request =
("data", `String svg_file)
])
| _ -> json_error "incomplete 'graph_svg' command"
end
end
*)
|
Some
command
->
json_error
(
sprintf
"command '%s' not found"
command
)
with
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment