opennlp.grok.realize
Class Chart

java.lang.Object
  |
  +--opennlp.grok.realize.Chart

public class Chart
extends java.lang.Object

The chart manages the creation of edges. Newly added edges are kept on an agenda prior to rule applications. A single chart instance per realization request is assumed.

Version:
$Revision: 1.12 $, $Date: 2003/02/25 12:13:56 $
Author:
Michael White

Field Summary
 Edge bestEdge
          The best edge found so far (or null), where a complete edge is always given preference to an incomplete one.
 boolean done
          Whether the realization request has been completed.
 EdgeFactory edgeFactory
          The edge factory for the realization request.
static int NO_TIME_LIMIT
          A constant indicating no time limit on edge combination.
 java.io.PrintWriter out
          The PrintWriter to use with the printing routines.
 long timeTilBest
          The time in ms until the best edge was found.
 long timeTilDone
          The time in ms until the search was finished.
 long timeTilFirst
          The time in ms until the first complete edge was found.
 long timeTilStopped
          The time in ms until the search was stopped.
static boolean USE_INDEXING
          Whether to use indexing to filter edges to combine.
 
Constructor Summary
Chart(EdgeFactory edgeFactory)
          Constructor.
 
Method Summary
 void combine(int timeLimitMS, boolean waitForCompleteEdge)
          Adds to the chart by iteratively moving an edge from the agenda to the chart, creating new edges for the agenda by applying available rules, while updating the best edge found so far, until done, or until the time limit (if any) is reached, or until the first complete edge is found (if beyond the time limit, and according to the given flag).
 void initialize()
          Initializes the agenda.
 void printAgenda()
          Prints the agenda.
 void printBestEdge()
          Prints the best edge found.
 void printEdges()
          Prints all chart edges, unsorted.
 void printEdges(boolean complete)
          Prints chart edges unsorted, using the complete edges filter according to the given flag.
 void printEdges(boolean complete, boolean sort)
          Prints chart edges using the complete edges filter according to the given flag and sorting according to the given flag.
 void printInitialEdges()
          Prints the initial edges.
 void printTiming()
          Prints the timing info.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

USE_INDEXING

public static boolean USE_INDEXING
Whether to use indexing to filter edges to combine.


edgeFactory

public final EdgeFactory edgeFactory
The edge factory for the realization request.


bestEdge

public Edge bestEdge
The best edge found so far (or null), where a complete edge is always given preference to an incomplete one.


done

public boolean done
Whether the realization request has been completed.


NO_TIME_LIMIT

public static final int NO_TIME_LIMIT
A constant indicating no time limit on edge combination.

See Also:
Constant Field Values

timeTilFirst

public long timeTilFirst
The time in ms until the first complete edge was found.


timeTilBest

public long timeTilBest
The time in ms until the best edge was found.


timeTilStopped

public long timeTilStopped
The time in ms until the search was stopped.


timeTilDone

public long timeTilDone
The time in ms until the search was finished.


out

public java.io.PrintWriter out
The PrintWriter to use with the printing routines. Default wraps System.out.

Constructor Detail

Chart

public Chart(EdgeFactory edgeFactory)
Constructor.

Method Detail

initialize

public void initialize()
Initializes the agenda.


combine

public void combine(int timeLimitMS,
                    boolean waitForCompleteEdge)
Adds to the chart by iteratively moving an edge from the agenda to the chart, creating new edges for the agenda by applying available rules, while updating the best edge found so far, until done, or until the time limit (if any) is reached, or until the first complete edge is found (if beyond the time limit, and according to the given flag).


printBestEdge

public void printBestEdge()
Prints the best edge found.


printTiming

public void printTiming()
Prints the timing info.


printEdges

public void printEdges()
Prints all chart edges, unsorted.


printEdges

public void printEdges(boolean complete)
Prints chart edges unsorted, using the complete edges filter according to the given flag.


printEdges

public void printEdges(boolean complete,
                       boolean sort)
Prints chart edges using the complete edges filter according to the given flag and sorting according to the given flag.


printAgenda

public void printAgenda()
Prints the agenda.


printInitialEdges

public void printInitialEdges()
Prints the initial edges.



Copyright © 2003 Jason Baldridge and Gann Bierner. All Rights Reserved.