Running Boxer (simple example)

Here is a simple example that shows how to combine the C&C parser with Boxer (note: if you use subversion you will need to add the option --candc-printer boxer):

% echo "Every man runs ." | bin/candc --models models/boxer > /tmp/test.ccg
# this file was generated by the following command(s):
#   bin/candc --models models/boxer

1 parsed at B=0.075, K=20
1 coverage 100%
1 stats 2.19722 77 83

This command created a file /tmp/test.ccg with the correct format for Boxer. Now we can use this file as input to Boxer:

bos@visitatori3:~/candc> bin/boxer --input /tmp/test.ccg --box true --flat true
% /tmp/test.ccg compiled 0.00 sec, 3,172 bytes

:- multifile     sem/5, id/2.
:- discontiguous sem/5, id/2.
:- dynamic       sem/5, id/2.

id(1,1).

%%% Every man runs .

sem(1,

    [
     word(1001, 'Every'),
     word(1002, man),
     word(1003, runs),
     word(1004, '.')
    ],

    [
     pos(1001, 'DT'),
     pos(1002, 'NN'),
     pos(1003, 'VBZ'),
     pos(1004, '.')
    ],

    [
    ],

    [
     l0:drs([], [l1]),
     l1:[1001]:imp(l2, l4),
     l4:drs([[1003]:_G3858], [l5, l6, l7]),
     l5:[1003]:pred(_G3858, run, v, 0),
     l6:[]:pred(_G3858, event, n, 1),
     l7:[1003]:rel(_G3858, _G3808, agent, 0),
     l2:drs([[1001]:_G3808], [l3]),
     l3:[1002]:pred(_G3808, man, n, 0)
    ]
   ).
  
/* ===== DRS (pretty print) =====

 __________________________________
|                                  |
|__________________________________|
|  _________       ______________  |
| | x1      |     | x2           | |
| |_________|     |______________| |
| | man(x1) | ==> | run(x2)      | |
| |_________|     | event(x2)    | |
|                 | agent(x2,x1) | |
|                 |______________| |
|__________________________________|

=============================== */

Attempted: 1. Completed: 1 (100.00%).

The output, a file in Prolog notation, is written to standard output. Using the --output <FILE> option, the output can be also be directed to a file.