edu.cmu.sphinx.util.props
Interface Configurable

All Known Subinterfaces:
AcousticModel, AcousticScorer, ActiveListManager, ConfidenceScorer, DataProcessor, DataProducer, Dictionary, DummyFrontEndProcessor, LanguageModel, Linguist, Loader, Monitor, Pruner, ResultListener, ResultProducer, Saver, ScoreNormalizer, SearchManager, StateListener
All Known Implementing Classes:
AbstractDecoder, AbstractSausageMaker, AbstractScorer, AbstractTestProcessor, AccuracyTracker, ActiveListFactory, AnotherDummyFrontEnd, AnotherDummyProcessor, AudioFileDataSource, BaseDataProcessor, BatchCMN, BatchForcedAlignerGrammar, BatchForcedAlignerRecognizer, BatchModeRecognizer, BatchNISTRecognizer, BeamFinder, BestConfidenceAccuracyTracker, BestPathAccuracyTracker, ComponentPropertyTest, ConcatAudioFileDataSource, ConcatFileDataSource, ConfigMonitor, ConfigurableAdapter, DataBlocker, DataBlockerTest, DataBufferProcessor, DataConverter, DataDumper, Decoder, DeltasFeatureExtractor, DiscreteCosineTransform, DiscreteCosineTransform2, DiscreteFourierTransform, Dither, DummyComp, DummyFrontEnd, DummyProcessor, DynamicFlatLinguist, EnergyPlotter, ExcessiveNonSpeechPruner, FastDictionary, FlatLinguist, ForcedAlignerGrammar, FrameDecoder, FrameDropper, FrontEnd, FrontEndSplitter, FSTGrammar, FullDictionary, GainControlProcessor, GDLDumper, Grammar, LargeTrigramModel, LDA, LexTreeLinguist, LinguistDumper, LinguistProcessor, LinguistStats, LiveCMN, LiveModeRecognizer, LMGrammar, LogMath, MAPConfidenceScorer, MaxScoreNormalizer, MelFrequencyFilterBank, MemoryTracker, Microphone, Model, Model, Model, Model, ModelLoader, ModelLoader, ModelLoader, ModelLoader, NonSpeechDataFilter, NonSpeechDataFilterTest, NullPruner, PartitionActiveListFactory, PivotSausageMaker, PLPCepstrumProducer, PLPFrequencyFilterBank, Preemphasizer, RaisedCosineWindower, Recognizer, RecognizerMonitor, RejectionTracker, S3FeatureExtractor, SausageMaker, SimpleAcousticScorer, SimpleActiveListFactory, SimpleActiveListManager, SimpleBreadthFirstSearchManager, SimpleNGramModel, SimplePruner, SimpleWordListGrammar, SortingActiveListFactory, SpeechClassifier, SpeechMarker, SpeechMarkerTest, SpeedTracker, Sphinx3Loader, StreamCepstrumSource, StreamDataSource, TestConfigurable, ThreadedAcousticScorer, TiedStateAcousticModel, TrivialAcousticModel, UnitManager, VUMeterMonitor, WavWriter, WordActiveListFactory, WordPruningBreadthFirstSearchManager

public interface Configurable

Defines the interface that must be implemented by any configurable component in Sphinx-4. The life cycle of a component is as follows:

Connecting to other components

Components often need to interact with other components in the system. One of the design goals of Sphinx-4 is that it allows for very flexible hookup of components in the system. Therefore, it is *not* considered good S4 style to hardcode which subcomponents a particular subcomponent is interacting with. Instead, the component should use the configuration manager to provide the hookup to another component.

For example, if a component needs to interact with a Linguist. Instead of explicitly setting which linguist is to be used via a constructor or via a setLinguist call, the component should instead define a configuration property for the linguist. This would be done like so:

     \@S4Component(type=Linguist.class)
     public static String PROP_LINGUIST = "linguist";
 

The linguist is made available in the newProperties method, like so:

     public void newProperties(PropertySheet propertySheet) {
      linguist = (Linguist) propertySheet.getComponent(PROP_LINGUIST);
     }
 

This getComponent call will find the proper linguist based upon the configuration data. Thus, if the configuration for this component had the 'linguist' defined to be 'dynamicLexTreeLinguist', then the configuration manager will look up and return a linguist with that name, creating and configuring it as necessary. Of course, the dynamicLexTreeLinguist itself may have a number of sub-components that will be created and configured as a result. If the component doesn't exist (but was defined to mandatory) and no configuration information is found in the config file for it, or if it is of the wrong type, a PropertyException will be thrown.


Method Summary
 void newProperties(PropertySheet ps)
          This method is called when this configurable component needs to be reconfigured.
 

Method Detail

newProperties

void newProperties(PropertySheet ps)
                   throws PropertyException
This method is called when this configurable component needs to be reconfigured.

Parameters:
ps - a property sheet holding the new data
Throws:
PropertyException - if there is a problem with the properties.