Phoenix Server

From Olympus

Revision as of 16:07, 29 April 2009 by Tkharris (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

The Phoenix Server is a Galaxy-wrapped version of the Phoenix robust semantic CFG parser.

You can test Phoenix grammars with parse_text.exe. This version is built against cygwin. See page 21 of the Phoenix manual for instructions.

When writing grammars one must produce a ProjectnameTask.gra file, and a ProjectnameTask.forms file. See the Phoenix Grammar Reference for more details. Those two files form the task grammar and, along with the generic grammar, are compiled into the application grammar as part of the compilations process (which can be done with MakeLM, as well as via other methods).

ProjectnameTask.forms

A forms file lists the functions that are expected by the application along with the grammar nets that can realize those functions. Here is a simple example (courtesy Dan Bohus):

FUNCTION: Statements  %%0.1%%
    NETS: 
	[UserPIN]
;

FUNCTION: Queries %%0.4%%  
	[QueryWhen]
	[QueryWho]
	[QueryAgenda]
	[QueryActionItems]
;

FUNCTION: MeetingRef  %%0.3%%
    NETS: 
  [MeetingReferent]
;

FUNCTION: Commands
    NETS:
  [ReadNotes]
;

# these auxiliaries are defined in order to capture some parses like
# next, this that, which o/w would parse as date-time
FUNCTION: Auxiliaries
    NETS:
	[__datetime_junk]
;

ProjectnameTask.gra

The grammar file defines a CFG to realize the nets contained in the forms file. See Phoenix Grammar Reference for details. Logios provides some extensions to the grammar as well. Here is an example (courtesy Dan Bohus):

###################################################################
# AUXILIARIES
###################################################################

[__datetime_junk]
	(next)
	(this)
	(an)
;

[_was]
  (was)
  (were)
;

###################################################################
# MEETING REFERENTS
###################################################################

[_meeting]
  (*the *group meeting)
  (*the one)
;

[last_meeting]
  (the last [_meeting])
  (my last [_meeting])
;
  
[previous_meeting]
  (the previous [_meeting])
  (my previous [_meeting])
  ([_meeting] before *that)
;

[that_meeting]
  (that [_meeting])
  (it)
;

[MeetingReferent]
  ([last_meeting])
  ([previous_meeting])
  ([that_meeting])
  ([_meeting])
;

###################################################################
# STATEMENTS
###################################################################

[user_name]
  (dbohus)
  (air)
  (banerjee)
  (archan)
  (dhuggins)
  (yitao)
  (dan)
  (alex)
  (bano)
  (arthur)
  (david)
  (i)
  (me)
;

[UserPIN]
	([user_name])
;

###################################################################
# QUERIES
###################################################################

[QueryWhenAndWho]
  ([QueryWhen] *and [QueryWho])
;

[QueryWhoAndAgenda]
  ([QueryWho] *and [QueryAgenda])
;

[QueryWhen]
  (WHEN was [MeetingReferent] *held)
  (WHEN did [MeetingReferent] HAPPEN)
WHEN
  (when)
  (at what time)
  (on which day)
HAPPEN
  (happed)
  (take place)
;

[QueryWho]
  (who ATTENDED *IN_MEETING)
  (HOW_MANY *PEOPLE ATTENDED *IN_MEETING)
HOW_MANY
  (how many)
  (which)
PEOPLE  
  (people)
  (participants)
ATTENDED
  ([_was])
  (attended)
  (participated)
  (went to)
  (met)
  (were the participants)
  (were the attendees)
IN_MEETING
  (*at [MeetingReferent])
  (in [MeetingReferent])
  (*in there)
;

[QueryAgenda]
  (what [_was] THE_AGENDA *IN_MEETING)
  (what WAS_TALKED *IN_MEETING)
THE_AGENDA
  (the agenda *items)
WAS_TALKED
  (was talked about)
  (did we talk about)
  (did they talk about)
  (was discussed)
  (did we discuss)
  (did they discuss)
IN_MEETING
  (*at [MeetingReferent])
  (in [MeetingReferent])
  (for [MeetingReferent])
  (*in there)
;

[QueryActionItems]
  (what [_was] the ACTION_ITEM)
  (what HAS_BEEN DECIDED *TO_DO *IN_MEETING)
  (DOES [user_name] have *any *action items)
  ([_was] *there ANYTHING DECIDED *IN_MEETING)
  ([_was] *there ANYTHING ASSIGNED_TO [user_name] *IN_MEETING)
  (DID_WE_ASSIGN ANYTHING to [user_name] *IN_MEETING)
  (DID_WE_ASSIGN [user_name] ANYTHING *IN_MEETING)
  (what *ACTION_ITEM DID_WE_ASSIGN to [user_name] *IN_MEETING)
  (what ACTION_ITEM did [user_name] GET *IN_MEETING)
  (what [_was] *the ACTION_ITEM for [user_name] *IN_MEETING)
  (what [_was] ASSIGNED_TO [user_name] *IN_MEETING)
DECIDED
  (decided)
  (decide)
  (assigned)
  (assign)
TO_DO
  (to do)
HAS_BEEN
  ([_was])
  (has been)
  (did we)
  (did they)
DOES
  (do)
  (does)
ANYTHING
  (*any ACTION_ITEM)
  (anything)
  (something)
ACTION_ITEM
  (*action items)
  (*action item)
  (tasks)
  (decisions)
  (to do items)
  (to do list)
ASSIGNED_TO
  (assigned to)
  (for)
IN_MEETING
  (in [MeetingReferent])
  (*at [MeetingReferent])
DID_WE_ASSIGN
  (were assigned)
  (did we assign)
  (did we give)
  (did they give)
  (did they assign)
GET
  (get)
  (have)
;

###################################################################
# COMMANDS
###################################################################

[ReadNotes]
  (read me the notes)
;