com.sun.labs.minion.pipeline
Class QuestioningStage

java.lang.Object
  extended by com.sun.labs.minion.pipeline.StageAdapter
      extended by com.sun.labs.minion.pipeline.QuestioningStage
All Implemented Interfaces:
Stage, PipelineStage, com.sun.labs.util.props.Component, com.sun.labs.util.props.Configurable

public class QuestioningStage
extends StageAdapter
implements com.sun.labs.util.props.Configurable

A Stage that tries to identify the questions within a document, and then sends the tokens that form the questions down to the next stage delimited as a field.


Field Summary
protected static java.lang.String logTag
          Tag for the log
static java.lang.String PROP_CHECK_NON_FIELD_QUESTIONS
          Whether we should look for questions in non-field text.
static java.lang.String PROP_QUESTION_CONTAINING_FIELDS
          A list of the fields containing questions that we would like to process.
static java.lang.String PROP_QUESTION_FIELD
           
 
Fields inherited from class com.sun.labs.minion.pipeline.StageAdapter
downstream, name
 
Constructor Summary
QuestioningStage()
           
 
Method Summary
 void dump(IndexConfig iC)
          Tells a stage that its data must be dumped to the index.
 void endDocument(long size)
          Processes the event that comes at the end of a document.
 void endField(FieldInfo fi)
          Processes the event that occurs at the end of a field.
 java.util.Set<java.lang.String> getQuestionContainingFields()
           
 void newProperties(com.sun.labs.util.props.PropertySheet propertySheet)
           
 void punctuation(Token p)
          Processes some punctuation from further up the pipeline.
 void setQuestionContainingFields(java.util.Set<java.lang.String> questionFields)
           
 void startDocument(java.lang.String key)
          Process the event that occurs at the start of a document.
 void startField(FieldInfo fi)
          Checks to see whether we're starting one of the fields in which we'll look for questions.
 void token(Token t)
          Processes a token from further up the pipeline.
 
Methods inherited from class com.sun.labs.minion.pipeline.StageAdapter
defineField, getDownstream, getName, savedData, setDownstream, setName, shutdown, text
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logTag

protected static final java.lang.String logTag
Tag for the log

See Also:
Constant Field Values

PROP_QUESTION_CONTAINING_FIELDS

@ConfigComponentList(type=FieldInfo.class)
public static final java.lang.String PROP_QUESTION_CONTAINING_FIELDS
A list of the fields containing questions that we would like to process.

See Also:
Constant Field Values

PROP_CHECK_NON_FIELD_QUESTIONS

@ConfigBoolean(defaultValue=true)
public static final java.lang.String PROP_CHECK_NON_FIELD_QUESTIONS
Whether we should look for questions in non-field text.

See Also:
Constant Field Values

PROP_QUESTION_FIELD

@ConfigComponent(type=FieldInfo.class)
public static final java.lang.String PROP_QUESTION_FIELD
See Also:
Constant Field Values
Constructor Detail

QuestioningStage

public QuestioningStage()
Method Detail

startDocument

public void startDocument(java.lang.String key)
Description copied from class: StageAdapter
Process the event that occurs at the start of a document.

Specified by:
startDocument in interface Stage
Overrides:
startDocument in class StageAdapter
Parameters:
key - The document key for this document.

startField

public void startField(FieldInfo fi)
Checks to see whether we're starting one of the fields in which we'll look for questions.

Specified by:
startField in interface Stage
Specified by:
startField in interface PipelineStage
Overrides:
startField in class StageAdapter
Parameters:
fi - The FieldInfo object that describes the field that is starting.
See Also:
StageAdapter.startField(com.sun.labs.minion.FieldInfo)

token

public void token(Token t)
Description copied from class: StageAdapter
Processes a token from further up the pipeline.

Specified by:
token in interface Stage
Overrides:
token in class StageAdapter
Parameters:
t - The token to process.

endField

public void endField(FieldInfo fi)
Processes the event that occurs at the end of a field.

Specified by:
endField in interface Stage
Specified by:
endField in interface PipelineStage
Overrides:
endField in class StageAdapter
Parameters:
fi - The FieldInfo object that describes the field that is ending.

punctuation

public void punctuation(Token p)
Description copied from class: StageAdapter
Processes some punctuation from further up the pipeline.

Specified by:
punctuation in interface Stage
Overrides:
punctuation in class StageAdapter
Parameters:
p - The punctuation to process.

dump

public void dump(IndexConfig iC)
Description copied from class: StageAdapter
Tells a stage that its data must be dumped to the index.

Specified by:
dump in interface Stage
Overrides:
dump in class StageAdapter
Parameters:
iC - The configuration for the index, which can be used to retrieve things like the index directory.

endDocument

public void endDocument(long size)
Description copied from class: StageAdapter
Processes the event that comes at the end of a document.

Specified by:
endDocument in interface Stage
Overrides:
endDocument in class StageAdapter
Parameters:
size - The size of the data that was processed for this file.

newProperties

public void newProperties(com.sun.labs.util.props.PropertySheet propertySheet)
                   throws com.sun.labs.util.props.PropertyException
Specified by:
newProperties in interface com.sun.labs.util.props.Configurable
Overrides:
newProperties in class StageAdapter
Throws:
com.sun.labs.util.props.PropertyException

getQuestionContainingFields

public java.util.Set<java.lang.String> getQuestionContainingFields()

setQuestionContainingFields

public void setQuestionContainingFields(java.util.Set<java.lang.String> questionFields)