edu.stanford.nlp.trees
Class Span

java.lang.Object
  |
  +--edu.stanford.nlp.trees.Constituent
        |
        +--edu.stanford.nlp.trees.SimpleConstituent
              |
              +--edu.stanford.nlp.trees.Span
All Implemented Interfaces:
Comparable, Label, Labeled, Scored

public final class Span
extends SimpleConstituent

A Span is an optimized SimpleConstituent object, It provides exactly the same functionality as a SimpleConstituent, but by being final, and with its own implementation of Span equality, it runs faster, so as to placate Dan Klein. (With JDK1.3 client, it still doesn't run as fast as an implementation outside of the SimpleConstituent hierarchy, but with JDK1.3 server, it does! And both versions are several times faster with -server than -client, so that should be used.)


Constructor Summary
Span()
          Create an empty Span object.
Span(int start, int end)
          Create a Span object with given values.
 
Method Summary
 ConstituentFactory constituentFactory()
          Return a factory for this kind of constituent.
 boolean equals(Span sp)
          An overloading for efficiency for when you know that you're comparing with a Span.
static ConstituentFactory factory()
          Return a factory for this kind of constituent.
 
Methods inherited from class edu.stanford.nlp.trees.SimpleConstituent
end, labelFactory, setEnd, setStart, start
 
Methods inherited from class edu.stanford.nlp.trees.Constituent
compareTo, equals, hashCode, label, labels, score, setFromString, setLabel, setLabels, setScore, setValue, size, toSentenceString, toString, value
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Span

public Span()
Create an empty Span object.


Span

public Span(int start,
            int end)
Create a Span object with given values.

Parameters:
start - start node of edge
end - end node of edge
Method Detail

equals

public boolean equals(Span sp)
An overloading for efficiency for when you know that you're comparing with a Span.

Parameters:
sp - the span to compare against
Returns:
whether they have the same start and end
See Also:
Constituent.equals(Object)

constituentFactory

public ConstituentFactory constituentFactory()
Return a factory for this kind of constituent. The factory returned is always the same one (a singleton).

Overrides:
constituentFactory in class SimpleConstituent
Returns:
The constituent factory

factory

public static ConstituentFactory factory()
Return a factory for this kind of constituent. The factory returned is always the same one (a singleton).

Returns:
The constituent factory


Stanford NLP Group