ENIAMsemTypes.ml 2.81 KB
(*
 *  ENIAMsemantics implements semantic processing for ENIAM
 *  Copyright (C) 2016-2017 Wojciech Jaworski <wjaworski atSPAMfree mimuw dot edu dot pl>
 *  Copyright (C) 2016-2017 Institute of Computer Science Polish Academy of Sciences
 *
 *  This library is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Lesser General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *)

type node = {
  orth: string;
  lemma: string;
  pos: string;
  weight: float;
  id: int;
  symbol: linear_term;
  arg_symbol: linear_term;
  arg_dir: string;
  (*agf: ENIAMwalTypes.gf;
  amorf: ENIAMwalTypes.morf;
  arole: string;
  arole_attr: string;
  meaning: string;
  hipero: StringSet.t;
  meaning_weight: float;
    position: ENIAMwalTypes.schema_field;*)
  attrs: (string * linear_term) list;
  args: linear_term;
  gf: string;
  role: string;
  role_attr: string;
  selprefs: linear_term;
  meaning: linear_term;
  arole: string;
  arole_attr: string;
  arev: bool;
  sem_args: linear_term;
}

and concept =
  {c_sense: linear_term; c_name: linear_term; (*c_visible_var: bool;*) c_quant: linear_term; c_local_quant: bool;
   (*c_modalities: (string * type_term) list;*)
   c_relations: linear_term; c_variable: (string * string); c_pos: int; c_cat: linear_term; c_proj: linear_term}

and context =
  {cx_sense: linear_term; cx_contents: linear_term; cx_relations: linear_term; cx_variable: (string * string); cx_pos: int}

and linear_term =
    Tuple of linear_term list
  | Variant of string * (string * linear_term) list (* etykieta * indeks * term *)
  | Dot
  | Val of string
  | Node of node
  | Concept of concept
  | Context of context
  | Relation of string * string * linear_term (* role * role_attr * concept *)
  | RevRelation of string * string * linear_term (* role * role_attr * concept *)
  | SingleRelation of linear_term
  | TripleRelation of string * string * linear_term * linear_term (* role * role_attr * concept *)
  | AddRelation of linear_term * string * string * linear_term (* nadrządnik * role * role_attr * podrzędnik *)
  | RemoveRelation of linear_term
  | SetContextName of linear_term * linear_term (* meaning * concept *)
  | MakeTripleRelation of string * string * linear_term (* role * role_attr * concept *)
  | Ref of int

let sem_lexicon_filename = ENIAMwalTypes.resource_path ^ "/semantics/lexicon-pl.dic"