%/**********************************************************************
  * @module    =  enju:semmodel
  * @copyright =  Copyright (c) 2005, Tsujii Laboratory, The University of Tokyo.
  * @copyright =  All rights reserved.
  * @cvs       =  $Id: semmodel.lil,v 1.4 2009-12-03 23:33:11 matuzaki Exp $
  * @version   =  Time-stamp: <2007-04-18 10:55:48 yusuke>
  * @desc      =  semmodel: feature forest model with semantic features
  **********************************************************************
%*/

:- module("enju:semmodel").

:- module_interface.

:- ensure_loaded("../mayz/parser").
:- ensure_loaded("forestprob").
:- ensure_loaded("semmask").

:- module_implementation.

:- ensure_loaded("tools").
:- ensure_loaded("lillib/debug").
:- set_debug_mode("enju_fom").

fom_binary(_, _, _, _, $Inactives, $FOM) :-
    semantics_weight($Inactives, $FOM).

fom_unary(_, _, _, $Inactives, $FOM) :-
    semantics_weight($Inactives, $FOM).

fom_root(_, 0.0).

fom_terminal(_, _, _, 0.0).

parser_init :-
    (get_enju_file_path("DATA/Enju-sem.output.gz", $SemFile) ->
     true ;
     error_message("Cannot find FOM file: DATA/Enju-sem.output.gz\n"),
     fail),
    debug_message("enju_fom", "  Loading Semantics FOM model: ~s\n", [$SemFile]),
    (import_forest_model($SemFile) ->
     true ;
     error_message("Cannot import forest model: ~s\n", [$SemFile]),
     fail).

