opennlp.grok.realize
Class Edge

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

public class Edge
extends java.lang.Object

An edge is a sign paired with a bitset representing its coverage of the input predicates. It also stores a completeness percentage and an n-gram precision. Edges are created by an EdgeFactory and managed by a Chart. The design follows the Singleton pattern.

Version:
$Revision: 1.4 $, $Date: 2003/01/10 22:27:42 $
Author:
Michael White

Field Summary
 java.util.BitSet bitset
          The coverage bitset.
 double completeness
          The completeness percentage.
 java.util.BitSet indices
          The indices bitset.
 double nGramPrecision
          The n-gram precision.
static boolean SHOW_COMPLETENESS
          Whether to show completeness info in toString.
 opennlp.common.synsem.Sign sign
          The sign.
 
Constructor Summary
Edge(opennlp.common.synsem.Sign sign, java.util.BitSet bitset, java.util.BitSet indices, double completeness, double nGramPrecision)
          Constructor.
 
Method Summary
 boolean complete()
          Returns whether this edge has completeness 1.0, ie, covers all the input preds.
 java.lang.String hashString()
          Returns a hash string for this edge.
 boolean indicesIntersect(Edge edge)
          Returns whether the indices bitset of this edge intersects with the indices bitset of the given one.
 boolean intersects(Edge edge)
          Returns whether the coverage bitset of this edge intersects with the coverage bitset of the given one.
 java.lang.String toString()
          Returns a string for the edge in the format {completeness} [nGramPrecision] orthography {bitset} :- category, where {completeness} and {bitset} are left out if SHOW_COMPLETENESS is false.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SHOW_COMPLETENESS

public static boolean SHOW_COMPLETENESS
Whether to show completeness info in toString.


sign

public final opennlp.common.synsem.Sign sign
The sign.


bitset

public final java.util.BitSet bitset
The coverage bitset.


indices

public final java.util.BitSet indices
The indices bitset.


completeness

public final double completeness
The completeness percentage.


nGramPrecision

public final double nGramPrecision
The n-gram precision.

Constructor Detail

Edge

public Edge(opennlp.common.synsem.Sign sign,
            java.util.BitSet bitset,
            java.util.BitSet indices,
            double completeness,
            double nGramPrecision)
Constructor.

Method Detail

complete

public boolean complete()
Returns whether this edge has completeness 1.0, ie, covers all the input preds.


intersects

public boolean intersects(Edge edge)
Returns whether the coverage bitset of this edge intersects with the coverage bitset of the given one.


indicesIntersect

public boolean indicesIntersect(Edge edge)
Returns whether the indices bitset of this edge intersects with the indices bitset of the given one.


hashString

public java.lang.String hashString()
Returns a hash string for this edge. NB: This method only relies on the sign, so it really should be moved to the Sign interface.


toString

public java.lang.String toString()
Returns a string for the edge in the format {completeness} [nGramPrecision] orthography {bitset} :- category, where {completeness} and {bitset} are left out if SHOW_COMPLETENESS is false.

Overrides:
toString in class java.lang.Object


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