grew_node.mli 2.46 KB
Newer Older
bguillaum's avatar
bguillaum committed
1 2 3 4 5 6 7 8 9 10
(**********************************************************************************)
(*    Libcaml-grew - a Graph Rewriting library dedicated to NLP applications      *)
(*                                                                                *)
(*    Copyright 2011-2013 Inria, Université de Lorraine                           *)
(*                                                                                *)
(*    Webpage: http://grew.loria.fr                                               *)
(*    License: CeCILL (see LICENSE folder or "http://www.cecill.info")            *)
(*    Authors: see AUTHORS file                                                   *)
(**********************************************************************************)

11
open Libgrew_utils
pj2m's avatar
pj2m committed
12 13
open Grew_fs
open Grew_edge
bguillaum's avatar
bguillaum committed
14
open Grew_ast
pj2m's avatar
pj2m committed
15

16 17 18 19 20 21 22 23 24
(* ================================================================================ *)
module G_node: sig
  type t

  val empty: t

  val to_string: t -> string
  val to_gr: t -> string

25
  val get_fs: t -> G_fs.t
26
  val get_next: t -> G_edge.t Massoc_gid.t
27

28
  val set_fs: t -> G_fs.t -> t
29
  val set_position: float -> t -> t
30

31 32
  val is_conll_root: t -> bool

bguillaum's avatar
bguillaum committed
33
  val remove: Gid.t -> G_edge.t -> t -> t
34

bguillaum's avatar
bguillaum committed
35
  val remove_key: Gid.t -> t -> t
36

37
  val merge_key: ?strict:bool -> Gid.t -> Gid.t -> t -> t option
bguillaum's avatar
bguillaum committed
38
  val shift_out: ?strict:bool -> t -> t -> t option
39 40 41

  val rm_out_edges: t -> t

42
  val add_edge: G_edge.t -> Gid.t -> t -> t option
43
  val build: ?def_position: float -> Ast.node -> (Id.name * t)
44
  val of_conll: ?loc:Loc.t -> Conll.line -> t
bguillaum's avatar
bguillaum committed
45

46 47 48
  val get_position: t -> float

  val position_comp: t -> t -> int
49

bguillaum's avatar
bguillaum committed
50 51
  val get_annot_info: t -> (string * string) option

52
  val build_neighbour: t -> t
53 54

  val rename: (Gid.t * Gid.t) list -> t -> t
55 56 57 58 59 60 61 62 63
end
(* ================================================================================ *)

(* ================================================================================ *)
module P_node: sig
  type t

  val empty: t

bguillaum's avatar
bguillaum committed
64
  val get_name: t -> Id.name
65
  val get_fs: t -> P_fs.t
bguillaum's avatar
bguillaum committed
66
  val get_next: t -> P_edge.t Massoc_pid.t
67

bguillaum's avatar
bguillaum committed
68 69 70
  (** [unif_fs fs t] replaces the feature structure of the node by node.fs unif fs *)
  val unif_fs: P_fs.t -> t -> t

71
  val build: ?pat_vars: string list -> Ast.node -> (Id.name * t)
72

bguillaum's avatar
bguillaum committed
73
  val add_edge: P_edge.t -> Pid.t -> t -> t option
74

75
  val match_: ?param: Lex_par.t -> t -> G_node.t -> Lex_par.t option
pj2m's avatar
pj2m committed
76

bguillaum's avatar
bguillaum committed
77
  val compare_pos: t -> t -> int
pj2m's avatar
pj2m committed
78
end
79
(* ================================================================================ *)