edu.cmu.minorthird.text.learn
Class SpanFE.SpanResult

java.lang.Object
  extended by edu.cmu.minorthird.text.learn.SpanFE.Result
      extended by edu.cmu.minorthird.text.learn.SpanFE.SpanResult
Enclosing class:
SpanFE

public static class SpanFE.SpanResult
extends SpanFE.Result

An intermediate result of an SpanFE process where a span is being processed.


Field Summary
 
Fields inherited from class edu.cmu.minorthird.text.learn.SpanFE.Result
fe, name
 
Constructor Summary
SpanFE.SpanResult(java.lang.String[] name, SpanFE fe, Span s)
           
 
Method Summary
 SpanFE.SpanSetResult contains(java.lang.String type)
          Move to a set of all spans of the named type that are contained by the current span.
 SpanFE.SpanResult doc()
          Move to the document containing this span.
 void emit()
          Terminates a feature extraction pipeline by actually emitting features.
 SpanFE.StringBagResult eq()
          Move to the string value of the span.
 SpanFE.StringBagResult exactSize()
          Make exact length of span a feature.
 Span getSpan()
           
 SpanFE.SpanResult left()
          Move to the span consisting of all tokens in the same document that precede the current span.
 SpanFE.SpanResult right()
          Move to the span consisting of all tokens in the same document that follow the current span.
 SpanFE.StringBagResult size()
          Make length of the span a feature.
 SpanFE.SpanResult subSpan(int lo, int len)
          Move to the specified subspan of the current span.
 SpanFE.TokenSetResult token(int index)
          Move to the specified token inside the span.
 SpanFE.TokenSetResult tokens()
          Move to the set of all tokens contained by this span.
 java.lang.String toString()
           
 SpanFE.SpanResult trace()
           
 
Methods inherited from class edu.cmu.minorthird.text.learn.SpanFE.Result
doTrace, extend, extend, getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SpanFE.SpanResult

public SpanFE.SpanResult(java.lang.String[] name,
                         SpanFE fe,
                         Span s)
Method Detail

trace

public SpanFE.SpanResult trace()

emit

public void emit()
Description copied from class: SpanFE.Result
Terminates a feature extraction pipeline by actually emitting features.

Specified by:
emit in class SpanFE.Result

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getSpan

public Span getSpan()

left

public SpanFE.SpanResult left()
Move to the span consisting of all tokens in the same document that precede the current span.


right

public SpanFE.SpanResult right()
Move to the span consisting of all tokens in the same document that follow the current span.


doc

public SpanFE.SpanResult doc()
Move to the document containing this span.


contains

public SpanFE.SpanSetResult contains(java.lang.String type)
Move to a set of all spans of the named type that are contained by the current span.


subSpan

public SpanFE.SpanResult subSpan(int lo,
                                 int len)
Move to the specified subspan of the current span. Invalid indices will be trimmed to a valid size. Negative indices mean to extract a subspan from the end of the current span, e.g., subSpan(-2,2) means to extract a span containing the last two tokens.


tokens

public SpanFE.TokenSetResult tokens()
Move to the set of all tokens contained by this span.


token

public SpanFE.TokenSetResult token(int index)
Move to the specified token inside the span. A negative index means to count from the end. An invalid index will result in an empty TokenSetResult.


eq

public SpanFE.StringBagResult eq()
Move to the string value of the span.


size

public SpanFE.StringBagResult size()
Make length of the span a feature. Eg feature is #tokens=3 for a 3-token span.


exactSize

public SpanFE.StringBagResult exactSize()
Make exact length of span a feature. Eg, feature is #tokens.3=1 for a 3-token span, #tokens_2=1 for a two-token span.