paths.ml 4.79 KB
(*
 *  ENIAM: Categorial Syntactic-Semantic Parser for Polish
 *  Copyright (C) 2016 Wojciech Jaworski <wjaworski atSPAMfree mimuw dot edu dot pl>
 *  Copyright (C) 2016 Institute of Computer Science Polish Academy of Sciences
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program 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 General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *)

let load_config () =
  try File.load_lines "../config"
  with _ -> File.load_lines "../../config"

let resources_path,walenty_filename,pre_port,pre_host,
    results_path,max_no_solutions,lcg_timeout,lcg_no_nodes,no_processes =
  Xlist.fold (load_config ()) ("../resources/","/usr/share/walenty/walenty.xml",3258,"localhost","../resuls/",10,100.,10000000,4) 
  (fun (resources_path,walenty_filename,pre_port,pre_host,results_path,max_no_solutions,lcg_timeout,lcg_no_nodes,no_processes) s ->
    match Str.split (Str.regexp "=") s with
      ["RESOURCES_PATH";resources_path] -> resources_path,walenty_filename,pre_port,pre_host,results_path,max_no_solutions,lcg_timeout,lcg_no_nodes,no_processes
    | ["WALENTY";walenty_filename] -> resources_path,walenty_filename,pre_port,pre_host,results_path,max_no_solutions,lcg_timeout,lcg_no_nodes,no_processes
    | ["PRE_PORT";pre_port] -> resources_path,walenty_filename,int_of_string pre_port,pre_host,results_path,max_no_solutions,lcg_timeout,lcg_no_nodes,no_processes
    | ["PRE_HOST";pre_host] -> resources_path,walenty_filename,pre_port,pre_host,results_path,max_no_solutions,lcg_timeout,lcg_no_nodes,no_processes
    | ["RESULTS_PATH";results_path] -> resources_path,walenty_filename,pre_port,pre_host,results_path,max_no_solutions,lcg_timeout,lcg_no_nodes,no_processes
    | ["MAX_NO_SOLUTIONS";max_no_solutions] -> resources_path,walenty_filename,pre_port,pre_host,results_path,int_of_string max_no_solutions,lcg_timeout,lcg_no_nodes,no_processes
    | ["LCG_TIMEOUT";lcg_timeout] -> resources_path,walenty_filename,pre_port,pre_host,results_path,max_no_solutions,float_of_string lcg_timeout,lcg_no_nodes,no_processes
    | ["LCG_NO_NODES";lcg_no_nodes] -> resources_path,walenty_filename,pre_port,pre_host,results_path,max_no_solutions,lcg_timeout,int_of_string lcg_no_nodes,no_processes
    | ["NO_PROCESSES";no_processes] -> resources_path,walenty_filename,pre_port,pre_host,results_path,max_no_solutions,lcg_timeout,lcg_no_nodes,int_of_string no_processes
    | [] -> resources_path,walenty_filename,pre_port,pre_host,results_path,max_no_solutions,lcg_timeout,lcg_no_nodes,no_processes
    | _ -> failwith ("invalid config format: " ^ s))

let alt_all = "alt1.tab"
let dict_all = "dict1.tab"
let rules_all = "rules1.tab"

(* let resources_path = "../resources/" *)
let sgjp_path = resources_path ^ "SGJP/"

(* let walenty_filename = "/usr/share/walenty/walenty.xml" *)

(* UWAGA: w razie wymiany słownika trzeba przekopiować definicję adv(pron),nonch,possp oraz wygenerować fixed.tab *)
let realizations_filename = resources_path ^ "Walenty/phrase_types_expand_20150909.txt"

let pre_port = 3258
let pre_host = "localhost"
(* let pre_host = "wloczykij" *)
(* let server_port = 3259 *)
(* let server_host = "localhost" *)
(* let server_host = "wloczykij" *)

let proper_names_filename = sgjp_path ^ "proper_names_sgjp_polimorf_20151020.tab"
let proper_names_filename2 = resources_path ^ "proper_names_20160104.tab"

let subst_uncountable_lexemes_filename = resources_path ^ "subst_uncountable.dat"
let subst_uncountable_lexemes_filename2 = resources_path ^ "subst_uncountable_stare.dat"
let subst_container_lexemes_filename = resources_path ^ "subst_container.dat"
let subst_numeral_lexemes_filename = resources_path ^ "subst_numeral.dat"
let subst_time_lexemes_filename = resources_path ^ "subst_time.dat"

let rzeczownik_filename = resources_path ^ "plWordnet/rzeczownik.tab"
let czasownik_filename = resources_path ^ "plWordnet/czasownik.tab"
let przymiotnik_filename = resources_path ^ "plWordnet/przymiotnik.tab"
let synsets_filename = resources_path ^ "plWordnet/synsets.tab"
let hipero_filename = resources_path ^ "plWordnet/hipero.tab"
let predef_filename = resources_path ^ "predef_prefs.tab"
let proper_classes_filename = resources_path ^ "proper_classes.tab"

let brev_filename = resources_path ^ "brev.tab"
let lemma_frequencies_filename = resources_path ^ "NKJP1M/NKJP1M-lemma-freq.tab"

let mte_filename = sgjp_path ^ "mte_20151215.tab"