Commit 8e1d5642 authored by Bruno Guillaume's avatar Bruno Guillaume

remove trailing white spaces

parent a5db32b3
true: package(unix, conll, dep2pict, camomile, cairo2, log) true: package(unix, conll, dep2pict, camomile, cairo2, log)
true: bin_annot
...@@ -364,7 +364,6 @@ module Ast = struct ...@@ -364,7 +364,6 @@ module Ast = struct
strat_loc: Loc.t; strat_loc: Loc.t;
} }
(** a GRS: graph rewriting system *) (** a GRS: graph rewriting system *)
type module_or_include = type module_or_include =
| Modul of modul | Modul of modul
......
...@@ -103,7 +103,7 @@ module File = struct ...@@ -103,7 +103,7 @@ module File = struct
let read file = let read file =
let in_ch = open_in file in let in_ch = open_in file in
try try
(* if the input file contains an UTF-8 byte order mark (EF BB BF), skip 3 bytes, else get back to 0 *) (* if the input file contains an UTF-8 byte order mark (EF BB BF), skip 3 bytes, else get back to 0 *)
(match input_byte in_ch with 0xEF -> seek_in in_ch 3 | _ -> seek_in in_ch 0); (match input_byte in_ch with 0xEF -> seek_in in_ch 3 | _ -> seek_in in_ch 0);
...@@ -146,7 +146,7 @@ module File = struct ...@@ -146,7 +146,7 @@ module File = struct
let buff = Buffer.create 32 in let buff = Buffer.create 32 in
try try
while true do while true do
let next = input_line ch in let next = input_line ch in
Printf.bprintf buff "%s\n" next Printf.bprintf buff "%s\n" next
done; assert false done; assert false
with End_of_file -> with End_of_file ->
......
...@@ -67,4 +67,3 @@ module Domain : sig ...@@ -67,4 +67,3 @@ module Domain : sig
(** [check_feature_name ~loc domain feature_name] fails iff a domain is set and [feature_name] is not defined in the current domain. *) (** [check_feature_name ~loc domain feature_name] fails iff a domain is set and [feature_name] is not defined in the current domain. *)
val check_feature_name: ?loc:Loc.t -> ?domain:t -> feature_name -> unit val check_feature_name: ?loc:Loc.t -> ?domain:t -> feature_name -> unit
end end
...@@ -46,7 +46,7 @@ module G_feature = struct ...@@ -46,7 +46,7 @@ module G_feature = struct
| (Some i, Some j) -> Pervasives.compare i j | (Some i, Some j) -> Pervasives.compare i j
| (Some i, None) -> -1 | (Some i, None) -> -1
| (None, Some j) -> 1 | (None, Some j) -> 1
| (None, None) -> Pervasives.compare name1 name2 | (None, None) -> Pervasives.compare name1 name2
let build ?domain = function let build ?domain = function
| ({Ast.kind=Ast.Equality [atom]; name=name},loc) -> | ({Ast.kind=Ast.Equality [atom]; name=name},loc) ->
...@@ -147,7 +147,7 @@ module P_feature = struct ...@@ -147,7 +147,7 @@ module P_feature = struct
| _ -> Error.bug "[P_feature.to_string] multiple parameters are not handled" | _ -> Error.bug "[P_feature.to_string] multiple parameters are not handled"
let build ?domain ?pat_vars = function let build ?domain ?pat_vars = function
| ({Ast.kind=Ast.Absent; name=name}, loc) -> | ({Ast.kind=Ast.Absent; name=name}, loc) ->
Domain.check_feature_name ~loc ?domain name; Domain.check_feature_name ~loc ?domain name;
(name, {cst=Absent;in_param=[];}) (name, {cst=Absent;in_param=[];})
| ({Ast.kind=Ast.Equality unsorted_values; name=name}, loc) -> | ({Ast.kind=Ast.Equality unsorted_values; name=name}, loc) ->
...@@ -354,8 +354,8 @@ module G_fs = struct ...@@ -354,8 +354,8 @@ module G_fs = struct
| [] -> "_" | [] -> "_"
| _ -> String.concat "|" | _ -> String.concat "|"
(List.map (List.map
(function (function
| (fn, String "true") -> fn | (fn, String "true") -> fn
| (fn, fv) -> (decode_feat_name fn)^"="^(string_of_value fv)) | (fn, fv) -> (decode_feat_name fn)^"="^(string_of_value fv))
ud_ordering ud_ordering
) )
......
...@@ -426,7 +426,7 @@ module G_graph = struct ...@@ -426,7 +426,7 @@ module G_graph = struct
| _ -> [] in | _ -> [] in
Conll.build_line ~id:(i+1) ~form ~lemma ~xpos:pos ~feats ~deps:([(i, "SUC")]) () Conll.build_line ~id:(i+1) ~form ~lemma ~xpos:pos ~feats ~deps:([(i, "SUC")]) ()
| _ -> Error.build "[Graph.of_brown] Cannot parse Brown item >>>%s<<< (expected \"phon/POS/lemma\") in >>>%s<<<" item brown | _ -> Error.build "[Graph.of_brown] Cannot parse Brown item >>>%s<<< (expected \"phon/POS/lemma\") in >>>%s<<<" item brown
) units in ) units in
of_conll ?domain { Conll.file=None; meta=[]; lines=conll_lines; multiwords=[] } of_conll ?domain { Conll.file=None; meta=[]; lines=conll_lines; multiwords=[] }
(* -------------------------------------------------------------------------------- *) (* -------------------------------------------------------------------------------- *)
...@@ -896,7 +896,7 @@ module G_graph = struct ...@@ -896,7 +896,7 @@ module G_graph = struct
let snodes = List.sort (fun (_,n1) (_,n2) -> G_node.position_comp n1 n2) nodes in let snodes = List.sort (fun (_,n1) (_,n2) -> G_node.position_comp n1 n2) nodes in
(* renumbering of nodes to have a consecutive sequence of int 1 --> n, in case of node deletion or addition *) (* renumbering of nodes to have a consecutive sequence of int 1 --> n, in case of node deletion or addition *)
let snodes = List.mapi let snodes = List.mapi
(fun i (gid,node) -> (gid, G_node.set_position (float i) node) (fun i (gid,node) -> (gid, G_node.set_position (float i) node)
) snodes in ) snodes in
......
...@@ -108,7 +108,7 @@ module G_graph: sig ...@@ -108,7 +108,7 @@ module G_graph: sig
val of_conll: ?domain:Domain.t -> Conll.t -> t val of_conll: ?domain:Domain.t -> Conll.t -> t
(** input : "Le/DET/le petit/ADJ/petit chat/NC/chat dort/V/dormir ./PONCT/." (** input : "Le/DET/le petit/ADJ/petit chat/NC/chat dort/V/dormir ./PONCT/."
It supposes that "SUC" is defined in current relations *) It supposes that "SUC" is defined in current relations *)
val of_brown: ?domain:Domain.t -> ?sentid: string -> string -> t val of_brown: ?domain:Domain.t -> ?sentid: string -> string -> t
...@@ -170,4 +170,4 @@ module G_graph: sig ...@@ -170,4 +170,4 @@ module G_graph: sig
val to_sentence: ?main_feat:string -> t -> string val to_sentence: ?main_feat:string -> t -> string
val to_dep: ?domain:Domain.t -> ?filter : string list -> ?main_feat:string -> ?deco:G_deco.t -> t -> string val to_dep: ?domain:Domain.t -> ?filter : string list -> ?main_feat:string -> ?deco:G_deco.t -> t -> string
val to_conll_string: ?domain:Domain.t -> t -> string val to_conll_string: ?domain:Domain.t -> t -> string
end (* module G_graph *) end (* module G_graph *)
\ No newline at end of file
...@@ -81,7 +81,7 @@ module Rewrite_history = struct ...@@ -81,7 +81,7 @@ module Rewrite_history = struct
let cpt = ref 0 in let cpt = ref 0 in
let rec loop t = let rec loop t =
match (t.good_nf, t.bad_nf) with match (t.good_nf, t.bad_nf) with
| [],[] -> | [],[] ->
File.write (Instance.to_conll_string ?domain t.instance) (sprintf "%s__%d.conll" base !cpt); File.write (Instance.to_conll_string ?domain t.instance) (sprintf "%s__%d.conll" base !cpt);
incr cpt incr cpt
| l, _ -> List.iter loop l | l, _ -> List.iter loop l
...@@ -458,7 +458,7 @@ module Grs = struct ...@@ -458,7 +458,7 @@ module Grs = struct
| None -> Error.bug "Cannot have no big_steps and more than one reducts at the same time" | None -> Error.bug "Cannot have no big_steps and more than one reducts at the same time"
| Some bs -> (bs, old_loop inst tail) | Some bs -> (bs, old_loop inst tail)
) inst_list ) inst_list
) in ) in
let indent = ref 10 in let indent = ref 10 in
......
...@@ -244,4 +244,3 @@ and const = parse ...@@ -244,4 +244,3 @@ and const = parse
| '(' { LPAREN } | '(' { LPAREN }
| ')' { RPAREN } | ')' { RPAREN }
| [^'(' ')' ' ']+ as id { ID id } | [^'(' ')' ' ']+ as id { ID id }
...@@ -33,4 +33,4 @@ module Parser : sig ...@@ -33,4 +33,4 @@ module Parser : sig
val pattern: string -> Ast.pattern val pattern: string -> Ast.pattern
val strat_def: string -> Ast.strat_def val strat_def: string -> Ast.strat_def
end end
\ No newline at end of file
...@@ -51,7 +51,7 @@ module G_node = struct ...@@ -51,7 +51,7 @@ module G_node = struct
let get_name gid t = match t.name with let get_name gid t = match t.name with
| Some n -> n | Some n -> n
| None -> sprintf "_%s_" (Gid.to_string gid) | None -> sprintf "_%s_" (Gid.to_string gid)
let empty = { name=None; fs = G_fs.empty; next = Massoc_gid.empty; succ = None; prec = None; position = -1.; conll_root=false; efs=[] } let empty = { name=None; fs = G_fs.empty; next = Massoc_gid.empty; succ = None; prec = None; position = -1.; conll_root=false; efs=[] }
...@@ -153,4 +153,4 @@ module P_node = struct ...@@ -153,4 +153,4 @@ module P_node = struct
else raise P_fs.Fail else raise P_fs.Fail
let compare_pos t1 t2 = Pervasives.compare t1.loc t2.loc let compare_pos t1 t2 = Pervasives.compare t1.loc t2.loc
end (* module P_node *) end (* module P_node *)
\ No newline at end of file
...@@ -193,4 +193,3 @@ module Concat_item = struct ...@@ -193,4 +193,3 @@ module Concat_item = struct
| Feat of (Gid.t * feature_name) | Feat of (Gid.t * feature_name)
| String of string | String of string
end (* module Concat_item *) end (* module Concat_item *)
...@@ -103,4 +103,3 @@ module Concat_item : sig ...@@ -103,4 +103,3 @@ module Concat_item : sig
| Feat of (Gid.t * feature_name) | Feat of (Gid.t * feature_name)
| String of string | String of string
end (* module Concat_item *) end (* module Concat_item *)
...@@ -37,15 +37,15 @@ let handle ?(name="") ?(file="No file defined") fct () = ...@@ -37,15 +37,15 @@ let handle ?(name="") ?(file="No file defined") fct () =
| Bug msg -> raise (Bug msg) | Bug msg -> raise (Bug msg)
(* Catch new exceptions *) (* Catch new exceptions *)
| Grew_base.Error.Parse (msg, Some loc) -> raise (Error (sprintf "%s %s" (Grew_base.Loc.to_string loc) msg)) | Grew_base.Error.Parse (msg, Some loc) -> raise (Error (sprintf "%s %s" (Grew_base.Loc.to_string loc) msg))
| Grew_base.Error.Parse (msg, None) -> raise (Error (sprintf "%s" msg)) | Grew_base.Error.Parse (msg, None) -> raise (Error (sprintf "%s" msg))
| Grew_base.Error.Build (msg, Some loc) -> raise (Error (sprintf "%s %s" (Grew_base.Loc.to_string loc) msg)) | Grew_base.Error.Build (msg, Some loc) -> raise (Error (sprintf "%s %s" (Grew_base.Loc.to_string loc) msg))
| Grew_base.Error.Build (msg, None) -> raise (Error (sprintf "%s" msg)) | Grew_base.Error.Build (msg, None) -> raise (Error (sprintf "%s" msg))
| Grew_base.Error.Run (msg, Some loc) -> raise (Error (sprintf "%s %s" (Grew_base.Loc.to_string loc) msg)) | Grew_base.Error.Run (msg, Some loc) -> raise (Error (sprintf "%s %s" (Grew_base.Loc.to_string loc) msg))
| Grew_base.Error.Run (msg, None) -> raise (Error (sprintf "%s" msg)) | Grew_base.Error.Run (msg, None) -> raise (Error (sprintf "%s" msg))
| Conll.Error msg -> raise (Error (sprintf "Conll error: %s" msg)) | Conll.Error msg -> raise (Error (sprintf "Conll error: %s" msg))
| Grew_base.Error.Bug (msg, Some loc) -> raise (Bug (sprintf "%s %s" (Grew_base.Loc.to_string loc) msg)) | Grew_base.Error.Bug (msg, Some loc) -> raise (Bug (sprintf "%s %s" (Grew_base.Loc.to_string loc) msg))
| Grew_base.Error.Bug (msg, None) -> raise (Bug (sprintf "%s" msg)) | Grew_base.Error.Bug (msg, None) -> raise (Bug (sprintf "%s" msg))
| exc -> raise (Bug (sprintf "[Libgrew.%s] UNCAUGHT EXCEPTION: %s" name (Printexc.to_string exc))) | exc -> raise (Bug (sprintf "[Libgrew.%s] UNCAUGHT EXCEPTION: %s" name (Printexc.to_string exc)))
......
...@@ -126,7 +126,7 @@ end ...@@ -126,7 +126,7 @@ end
(** {2 Rewrite history} *) (** {2 Rewrite history} *)
(* ==================================================================================================== *) (* ==================================================================================================== *)
module Rewrite: sig module Rewrite: sig
type display = Libgrew_types.rew_display type display = Libgrew_types.rew_display
type history type history
......
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