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: bin_annot
......@@ -364,7 +364,6 @@ module Ast = struct
strat_loc: Loc.t;
}
(** a GRS: graph rewriting system *)
type module_or_include =
| Modul of modul
......
......@@ -103,7 +103,7 @@ module File = struct
let read file =
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 *)
(match input_byte in_ch with 0xEF -> seek_in in_ch 3 | _ -> seek_in in_ch 0);
......@@ -146,7 +146,7 @@ module File = struct
let buff = Buffer.create 32 in
try
while true do
let next = input_line ch in
let next = input_line ch in
Printf.bprintf buff "%s\n" next
done; assert false
with End_of_file ->
......
......@@ -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. *)
val check_feature_name: ?loc:Loc.t -> ?domain:t -> feature_name -> unit
end
......@@ -46,7 +46,7 @@ module G_feature = struct
| (Some i, Some j) -> Pervasives.compare i j
| (Some i, None) -> -1
| (None, Some j) -> 1
| (None, None) -> Pervasives.compare name1 name2
| (None, None) -> Pervasives.compare name1 name2
let build ?domain = function
| ({Ast.kind=Ast.Equality [atom]; name=name},loc) ->
......@@ -147,7 +147,7 @@ module P_feature = struct
| _ -> Error.bug "[P_feature.to_string] multiple parameters are not handled"
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;
(name, {cst=Absent;in_param=[];})
| ({Ast.kind=Ast.Equality unsorted_values; name=name}, loc) ->
......@@ -354,8 +354,8 @@ module G_fs = struct
| [] -> "_"
| _ -> String.concat "|"
(List.map
(function
| (fn, String "true") -> fn
(function
| (fn, String "true") -> fn
| (fn, fv) -> (decode_feat_name fn)^"="^(string_of_value fv))
ud_ordering
)
......
......@@ -426,7 +426,7 @@ module G_graph = struct
| _ -> [] in
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
) units in
) units in
of_conll ?domain { Conll.file=None; meta=[]; lines=conll_lines; multiwords=[] }
(* -------------------------------------------------------------------------------- *)
......@@ -896,7 +896,7 @@ module G_graph = struct
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 *)
let snodes = List.mapi
let snodes = List.mapi
(fun i (gid,node) -> (gid, G_node.set_position (float i) node)
) snodes in
......
......@@ -108,7 +108,7 @@ module G_graph: sig
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 *)
val of_brown: ?domain:Domain.t -> ?sentid: string -> string -> t
......@@ -170,4 +170,4 @@ module G_graph: sig
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_conll_string: ?domain:Domain.t -> t -> string
end (* module G_graph *)
\ No newline at end of file
end (* module G_graph *)
......@@ -81,7 +81,7 @@ module Rewrite_history = struct
let cpt = ref 0 in
let rec loop t =
match (t.good_nf, t.bad_nf) with
| [],[] ->
| [],[] ->
File.write (Instance.to_conll_string ?domain t.instance) (sprintf "%s__%d.conll" base !cpt);
incr cpt
| l, _ -> List.iter loop l
......@@ -458,7 +458,7 @@ module Grs = struct
| None -> Error.bug "Cannot have no big_steps and more than one reducts at the same time"
| Some bs -> (bs, old_loop inst tail)
) inst_list
) in
) in
let indent = ref 10 in
......
......@@ -244,4 +244,3 @@ and const = parse
| '(' { LPAREN }
| ')' { RPAREN }
| [^'(' ')' ' ']+ as id { ID id }
......@@ -33,4 +33,4 @@ module Parser : sig
val pattern: string -> Ast.pattern
val strat_def: string -> Ast.strat_def
end
\ No newline at end of file
end
......@@ -51,7 +51,7 @@ module G_node = struct
let get_name gid t = match t.name with
| 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=[] }
......@@ -153,4 +153,4 @@ module P_node = struct
else raise P_fs.Fail
let compare_pos t1 t2 = Pervasives.compare t1.loc t2.loc
end (* module P_node *)
\ No newline at end of file
end (* module P_node *)
......@@ -193,4 +193,3 @@ module Concat_item = struct
| Feat of (Gid.t * feature_name)
| String of string
end (* module Concat_item *)
......@@ -103,4 +103,3 @@ module Concat_item : sig
| Feat of (Gid.t * feature_name)
| String of string
end (* module Concat_item *)
......@@ -37,15 +37,15 @@ let handle ?(name="") ?(file="No file defined") fct () =
| Bug msg -> raise (Bug msg)
(* 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, 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, 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, None) -> raise (Error (sprintf "%s" 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.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.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))
| 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))
| exc -> raise (Bug (sprintf "[Libgrew.%s] UNCAUGHT EXCEPTION: %s" name (Printexc.to_string exc)))
......
......@@ -126,7 +126,7 @@ end
(** {2 Rewrite history} *)
(* ==================================================================================================== *)
module Rewrite: sig
type display = Libgrew_types.rew_display
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