Commit 42f1d4f2 authored by Bruno Guillaume's avatar Bruno Guillaume

version 2.25: add -rtl option for right-to-left display

parent 078db3cb
......@@ -30,6 +30,7 @@ end (* module File *)
let batch = ref false
let rtl = ref false
let critical msg = ksprintf
(fun m -> match !batch with
......
......@@ -41,7 +41,7 @@ let main () =
(* -------------------------------------------------------------------------------- *)
let refresh_view () =
let graph = match (!current_data, !current_position) with
| (Conll arr, p) -> Dep2pict.from_conll (snd arr.(p))
| (Conll arr, p) -> Dep2pict.from_conll ~rtl:!rtl ~conll:(snd arr.(p))
| (Dep graph, _) -> graph in
let svg = Dep2pict.to_svg graph in
......@@ -133,7 +133,7 @@ let main () =
~callback:(fun () ->
begin
let graph = match (!current_data, !current_position) with
| (Conll arr, p) -> Dep2pict.from_conll (snd arr.(p))
| (Conll arr, p) -> Dep2pict.from_conll ~rtl:!rtl ~conll:(snd arr.(p))
| (Dep graph, _) -> graph in
match format with
......
......@@ -63,6 +63,7 @@ let rec parse_arg = function
| "-b"::tail | "--batch"::tail -> batch := true; parse_arg tail
| "-rtl":: tail | "--right_to_left":: tail -> rtl := true; parse_arg tail
| s::_ when s.[0] = '-' -> Log.fcritical "Unknwon option \"%s\"" s
| anon :: tail ->
......@@ -102,7 +103,7 @@ let _ =
set_position ();
let graph = match (!current_data, !current_position) with
| (Dep g,_) -> g
| (Conll arr, pos) -> Dep2pict.from_conll (snd arr.(pos)) in
| (Conll arr, pos) -> Dep2pict.from_conll ~rtl:!rtl ~conll:(snd arr.(pos)) in
begin
match Format.get out_file with
| Format.Svg -> Dep2pict.save_svg ~filename:out_file graph
......
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