edu.cmu.sphinx.frontend.endpoint
Class NonSpeechDataFilter

java.lang.Object
  extended by edu.cmu.sphinx.frontend.BaseDataProcessor
      extended by edu.cmu.sphinx.frontend.endpoint.NonSpeechDataFilter
All Implemented Interfaces:
DataProcessor, Configurable

public class NonSpeechDataFilter
extends BaseDataProcessor

Given a sequence of Data, filters out the non-speech regions. The sequence of Data should have the speech and non-speech regions marked out by the SpeechStartSignal and SpeechEndSignal, using the SpeechMarker. Such a sequence of Data for an utterance should look like one of the following two:

Case 1: Only one speech region

In the first case, the data stream has only one speech region:


Figure 1: A data stream with only one speech region.

After filtering, the non-speech regions are removed, and becomes:


Figure 2: A data stream with only on speech region after filtering.


Case 2: Multiple speech regions

We will use the example of a data stream with two speech regions to illustrate the case of a data stream with multiple speech regions:


Figure 3: A data stream with two speech regions.

This case is more complicated than one speech region. The property mergeSpeechSegments is very important in controlling the behavior of this filter. This property determines whether individual speech regions (and the non-speech regions between them) in an utterance should be merged into one big region, or whether the individual speech regions should be converted into individual utterances. If mergeSpeechSegments is set to true, all the Data from the first SpeechStartSignal to the last SpeechEndSignal will be considered as one Utterance, and enclosed by a pair of SpeechEndSignal and SpeechEndSignal (which itself becomes enclosed by a pair of DataStartSignal and DataEndSignal). All non-speech regions are removed from the stream. This gives:


Figure 4: A data stream with two speech regions after filtering, when mergeSpeechSegments is set to true.

On the other hand, if mergeSpeechSegments is set to false (the default), then each speech region will become its own data stream. Pictorially, our data stream with two speech regions becomes:


Figure 5: A data stream with two speech regions after filtering, when mergeSpeechSegments is set to false.


Field Summary
static java.lang.String PROP_MERGE_SPEECH_SEGMENTS
          The Sphinx Property that controls whether to merge discontiguous speech segments (and the non-speech segments between them) in an utterance into one big segment (true), or to treat the individual speech segments as individual utterances (false).
 
Constructor Summary
NonSpeechDataFilter()
           
 
Method Summary
 Data getData()
          Returns the next Data or Signal.
 void initialize()
          Initializes this data processor
 void newProperties(PropertySheet ps)
          This method is called when this configurable component needs to be reconfigured.
 
Methods inherited from class edu.cmu.sphinx.frontend.BaseDataProcessor
getPredecessor, getTimer, setPredecessor, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROP_MERGE_SPEECH_SEGMENTS

@S4Boolean(defaultValue=false)
public static final java.lang.String PROP_MERGE_SPEECH_SEGMENTS
The Sphinx Property that controls whether to merge discontiguous speech segments (and the non-speech segments between them) in an utterance into one big segment (true), or to treat the individual speech segments as individual utterances (false).

See Also:
Constant Field Values
Constructor Detail

NonSpeechDataFilter

public NonSpeechDataFilter()
Method Detail

newProperties

public void newProperties(PropertySheet ps)
                   throws PropertyException
Description copied from interface: Configurable
This method is called when this configurable component needs to be reconfigured.

Specified by:
newProperties in interface Configurable
Overrides:
newProperties in class BaseDataProcessor
Parameters:
ps - a property sheet holding the new data
Throws:
PropertyException - if there is a problem with the properties.

initialize

public void initialize()
Initializes this data processor

Specified by:
initialize in interface DataProcessor
Overrides:
initialize in class BaseDataProcessor

getData

public Data getData()
             throws DataProcessingException
Returns the next Data or Signal.

Specified by:
getData in interface DataProcessor
Specified by:
getData in class BaseDataProcessor
Returns:
the next Data, or null if no Data is available
Throws:
DataProcessingException - if a data processing error occurs