Commit 898d6eaf authored by bguillaum's avatar bguillaum

code cleaning, typos

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/semagramme/libcaml-grew/trunk@9100 7838e531-6607-4d57-9587-6c381814729c
parent 4e2c03fc
......@@ -59,8 +59,8 @@ module Rewrite_history = struct
son in
nfs @ acc
)
[] l
in loop base_name [] t
[] l in
loop base_name [] t
let save_gr ?domain base t =
let rec loop file_name t =
......
......@@ -81,7 +81,7 @@ end (* module Modul *)
module Grs: sig
type t
val empty:t
val empty: t
val get_modules: t -> Modul.t list
......@@ -100,7 +100,7 @@ module Grs: sig
val rewrite: t -> string -> G_graph.t -> Rewrite_history.t
(* only externeal strucutre is returned, each edge contains a "dummy" big_step *)
(* only external structure is returned, each edge contains a "dummy" big_step *)
val build_rew_display: t -> string -> G_graph.t -> Libgrew_types.rew_display
val rule_iter: (string -> Rule.t -> unit) -> t -> unit
......
......@@ -332,137 +332,3 @@ module Rewrite = struct
let html_sentences ~title = handle ~name:"Rewrite.html_sentences" (fun () -> Grew_html.Html_sentences.build ~title) ()
end
(* -------------- remove... after merge ------------
let xml_graph xml =
handle ~name:"xml_graph" (fun () -> G_graph.of_xml xml) ()
let rewrite ~gr ~grs ~seq =
handle ~name:"rewrite" (fun () -> Grs.rewrite grs seq gr) ()
let display ~gr ~grs ~seq =
handle ~name:"display" (fun () -> Grs.build_rew_display grs seq gr) ()
let write_stat filename rew_hist =
handle ~name:"write_stat" (fun () -> Gr_stat.save filename (Gr_stat.from_rew_history rew_hist)) ()
let write_annot ~title static_dir annot_dir base_name_rew_hist_list =
handle ~name:"write_annot" (fun () -> Html_annot.build ~title static_dir annot_dir base_name_rew_hist_list) ()
let save_index ~dirname ~base_names =
handle ~name:"save_index" (fun () ->
let out_ch = open_out (Filename.concat dirname "index") in
List.iter (fun f -> fprintf out_ch "%s\n" f) base_names;
close_out out_ch
) ()
let save_graph_conll filename graph =
handle ~name:"save_graph_conll" (fun () ->
let out_ch = open_out filename in
fprintf out_ch "%s" (G_graph.to_conll graph);
close_out out_ch
) ()
let save_gr base rew_hist =
handle ~name:"save_gr" (fun () -> Rewrite_history.save_gr base rew_hist) ()
let save_conll base rew_hist =
handle ~name:"save_conll" (fun () -> Rewrite_history.save_conll base rew_hist) ()
let save_full_conll base rew_hist =
handle ~name:"save_full_conll" (fun () -> Rewrite_history.save_full_conll base rew_hist) ()
let save_det_gr base rew_hist =
handle ~name:"save_det_gr" (fun () -> Rewrite_history.save_det_gr base rew_hist) ()
let save_det_conll ?header base rew_hist =
handle ~name:"save_deeeet_conll" (fun () -> Rewrite_history.save_det_conll ?header base rew_hist) ()
let det_dep_string rew_hist =
handle ~name:"det_dep_string" (fun () -> Rewrite_history.det_dep_string rew_hist) ()
let conll_dep_string ?keep_empty_rh rew_hist =
handle ~name:"conll_dep_string" (fun () -> Rewrite_history.conll_dep_string ?keep_empty_rh rew_hist) ()
let write_html
?(no_init=false)
?(out_gr=false)
?filter
?main_feat
?dot
~header
?graph_file
rew_hist
output_base =
handle ~name:"write_html" (fun () ->
ignore (
Html_rh.build
?filter
?main_feat
?dot
~out_gr
~init_graph: (not no_init)
~header
?graph_file
output_base rew_hist
)
) ()
let error_html
?(no_init=false)
?main_feat
?dot
~header
msg
?init
output_base =
handle ~name:"error_html" (fun () ->
ignore (
Html_rh.error
?main_feat
?dot
~init_graph: (not no_init)
~header
output_base msg init
)
) ()
let make_index ~title ~grs_file ~html ~grs ~seq ~input_dir ~output_dir ~base_names =
handle ~name:"make_index" (fun () ->
let init = Corpus_stat.empty grs seq in
let corpus_stat =
List.fold_left
(fun acc base_name ->
Corpus_stat.add_gr_stat base_name (Gr_stat.load (Filename.concat output_dir (base_name^".stat"))) acc
) init base_names in
Corpus_stat.save_html title grs_file input_dir output_dir corpus_stat
) ()
let html_sentences ~title = handle ~name:"html_sentences" (fun () -> Html_sentences.build ~title) ()
let feature_names () = handle ~name:"feature_names" (fun () -> Domain.feature_names ()) ()
let to_dot_graph ?main_feat ?(deco=G_deco.empty) graph =
handle ~name:"to_dot_graph" (fun () -> G_graph.to_dot ?main_feat graph ~deco) ()
let to_dep_graph ?filter ?main_feat ?(deco=G_deco.empty) graph =
handle ~name:"to_dep_graph" (fun () -> G_graph.to_dep ?filter ?main_feat ~deco graph) ()
let to_gr_graph graph =
handle ~name:"to_gr_graph" (fun () -> G_graph.to_gr graph) ()
let to_conll_graph graph =
handle ~name:"to_conll_graph" (fun () -> G_graph.to_conll graph) ()
type pattern = Rule.pattern
type matching = Rule.matching
let load_pattern file =
handle ~name:"load_pattern" (fun () -> Rule.build_pattern (Loader.pattern file)) ()
let match_in_graph pattern graph = Rule.match_in_graph pattern graph
let match_deco pattern matching = Rule.match_deco pattern matching
-------------- remove... after merge ------------ *)
......@@ -198,14 +198,3 @@ module Rewrite: sig
val html_sentences: title:string -> string -> (bool * string * int * string) list -> unit
end
(* (* type and function added for grew-web *)
type pattern
type matching
(** [load_pattern file] returns the pattern described in the given [file] *)
val load_pattern: string -> pattern
(** [match_in_graph pattern graph] returns the list of the possible matching of [pattern] in [graph] *)
val match_in_graph: pattern -> Graph.t -> matching list
*)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment