当前位置: 首页>>代码示例>>Java>>正文


Java PropertyException类代码示例

本文整理汇总了Java中edu.cmu.sphinx.util.props.PropertyException的典型用法代码示例。如果您正苦于以下问题:Java PropertyException类的具体用法?Java PropertyException怎么用?Java PropertyException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


PropertyException类属于edu.cmu.sphinx.util.props包,在下文中一共展示了PropertyException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: newProperties

import edu.cmu.sphinx.util.props.PropertyException; //导入依赖的package包/类
@Override
public void newProperties(PropertySheet ps) throws PropertyException {
	super.newProperties(ps);
	logger = ps.getLogger();

	sampleRate = ps.getInt(PROP_SAMPLE_RATE);

	int sampleSizeInBits = ps.getInt(PROP_BITS_PER_SAMPLE);

	int channels = ps.getInt(PROP_CHANNELS);
	bigEndian = ps.getBoolean(PROP_BIG_ENDIAN);
	signed = ps.getBoolean(PROP_SIGNED);

	desiredFormat = new AudioFormat((float) sampleRate, sampleSizeInBits, channels, signed, bigEndian);

	closeBetweenUtterances = ps.getBoolean(PROP_CLOSE_BETWEEN_UTTERANCES);
	msecPerRead = ps.getInt(PROP_MSEC_PER_READ);
	keepDataReference = ps.getBoolean(PROP_KEEP_LAST_AUDIO);
	stereoToMono = ps.getString(PROP_STEREO_TO_MONO);
	selectedChannel = ps.getInt(PROP_SELECT_CHANNEL);
	selectedMixerIndex = ps.getString(PROP_SELECT_MIXER);
	audioBufferSize = ps.getInt(PROP_BUFFER_SIZE);
}
 
开发者ID:CognitiveModeling,项目名称:BrainControl,代码行数:24,代码来源:Microphone.java

示例2: initSphinx

import edu.cmu.sphinx.util.props.PropertyException; //导入依赖的package包/类
/**
 * Configures Sphinx so that the mapping procedure can be started.
 */
private void initSphinx() 
{
	ConfigurationManager configurationManager = VoiceRecognitionInput.createConfigurationManager("speechSynthesis/responses.config.xml");

	try {
		this.recognizer = (Recognizer) configurationManager.lookup("recognizer");
		this.recognizer.allocate();
		this.grammar = (JSGFGrammar) configurationManager.lookup("jsgfGrammar");
		this.parser = new RuleParser(grammar);
		
		regenerate();

		this.recognizer.deallocate();

	} catch (PropertyException e) {
		System.out.println("Problem configuring: " + e);
	}
}
 
开发者ID:CognitiveModeling,项目名称:BrainControl,代码行数:22,代码来源:TagsToSentences.java

示例3: newProperties

import edu.cmu.sphinx.util.props.PropertyException; //导入依赖的package包/类
@Override
public void newProperties(PropertySheet ps) throws PropertyException {
    // hookup to all of the components
    logger = ps.getLogger();
    acousticModel = (AcousticModel) ps.getComponent(ACOUSTIC_MODEL);

    logMath = LogMath.getInstance();
    grammar = (Grammar) ps.getComponent(GRAMMAR);

    // get the rest of the configuration data
    logWordInsertionProbability = logMath.linearToLog(ps.getDouble(PROP_WORD_INSERTION_PROBABILITY));
    logSilenceInsertionProbability = logMath.linearToLog(ps.getDouble(PROP_SILENCE_INSERTION_PROBABILITY));
    logUnitInsertionProbability = logMath.linearToLog(ps.getDouble(PROP_UNIT_INSERTION_PROBABILITY));
    logFillerInsertionProbability = logMath.linearToLog(ps.getDouble(PROP_FILLER_INSERTION_PROBABILITY));
    languageWeight = ps.getFloat(Linguist.PROP_LANGUAGE_WEIGHT);
    addOutOfGrammarBranch = ps.getBoolean(ADD_OUT_OF_GRAMMAR_BRANCH);
    logOutOfGrammarBranchProbability = logMath.linearToLog(ps.getDouble(OUT_OF_GRAMMAR_PROBABILITY));
    
    logPhoneInsertionProbability = logMath.linearToLog(ps.getDouble(PHONE_INSERTION_PROBABILITY));
    if (addOutOfGrammarBranch) {
        phoneLoopAcousticModel = (AcousticModel) ps.getComponent(PHONE_LOOP_ACOUSTIC_MODEL);
    }
}
 
开发者ID:knowledgetechnologyuhh,项目名称:docks,代码行数:24,代码来源:OurDynamicFlatLinguist.java

示例4: newProperties

import edu.cmu.sphinx.util.props.PropertyException; //导入依赖的package包/类
@Override
public void newProperties(PropertySheet ps) throws PropertyException {


    if (allocated) {
        throw new RuntimeException("Can't change properties after allocation");
    }

    urlLocation = ConfigurationManagerUtils.getResource(PROP_LOCATION, ps);
    unigramWeight = ps.getFloat(PROP_UNIGRAM_WEIGHT);
    logMath = (LogMath) ps.getComponent(PROP_LOG_MATH);
    desiredMaxDepth = ps.getInt(PROP_MAX_DEPTH);
    dictionary = (Dictionary) ps.getComponent(PROP_DICTIONARY);
    map = new HashMap<WordSequence, Probability>();
    vocabulary = new HashSet<String>();
}
 
开发者ID:juanma2268,项目名称:jumbertoTeia2600,代码行数:17,代码来源:SimpleNGramModel.java

示例5: newProperties

import edu.cmu.sphinx.util.props.PropertyException; //导入依赖的package包/类
@Override
public void newProperties(PropertySheet ps) throws PropertyException {
	// logger = ps.getLogger();
	grammar = (JSGFGrammar) ps.getComponent(PROP_JSGF_GRAMMAR);
	microphone = (Microphone) ps.getComponent(PROP_MICROPHONE);
	recognizer = (Recognizer) ps.getComponent(PROP_RECOGNIZER);
}
 
开发者ID:glaudiston,项目名称:project-bianca,代码行数:8,代码来源:DialogManager.java

示例6: newProperties

import edu.cmu.sphinx.util.props.PropertyException; //导入依赖的package包/类
@Override
public void newProperties(PropertySheet ps) throws PropertyException {
    super.newProperties(ps);
    lambdaPower = ps.getDouble(LAMBDA_POWER);
    lambdaA = ps.getDouble(LAMBDA_A);
    lambdaB = ps.getDouble(LAMBDA_B);
}
 
开发者ID:knowledgetechnologyuhh,项目名称:docks,代码行数:8,代码来源:Denoise.java

示例7: newProperties

import edu.cmu.sphinx.util.props.PropertyException; //导入依赖的package包/类
@Override
public void newProperties(PropertySheet ps) throws PropertyException {
    super.newProperties(ps);
    initialMean = ps.getDouble(PROP_INITIAL_MEAN);
    cmnWindow = ps.getInt(PROP_CMN_WINDOW);
    cmnShiftWindow = ps.getInt(PROP_CMN_SHIFT_WINDOW);
}
 
开发者ID:juanma2268,项目名称:jumbertoTeia2600,代码行数:8,代码来源:LiveCMN.java

示例8: newProperties

import edu.cmu.sphinx.util.props.PropertyException; //导入依赖的package包/类
@Override
public void newProperties(PropertySheet ps) throws PropertyException {
    super.newProperties(ps);

    alpha = ps.getDouble(PROP_ALPHA);
    windowSizeInMs = ps.getFloat(PROP_WINDOW_SIZE_MS);
    windowShiftInMs = ps.getFloat(PROP_WINDOW_SHIFT_MS);
}
 
开发者ID:juanma2268,项目名称:jumbertoTeia2600,代码行数:9,代码来源:RaisedCosineWindower.java

示例9: newProperties

import edu.cmu.sphinx.util.props.PropertyException; //导入依赖的package包/类
@Override
public void newProperties(PropertySheet ps) throws PropertyException {
    super.newProperties(ps);

    ditherMax = ps.getDouble(PROP_MAX_DITHER);
    useRandSeed = ps.getBoolean(PROP_USE_RANDSEED);

    maxValue = ps.getDouble(PROP_MAX_VAL);
    minValue = ps.getDouble(PROP_MIN_VAL);
}
 
开发者ID:juanma2268,项目名称:jumbertoTeia2600,代码行数:11,代码来源:Dither.java

示例10: newProperties

import edu.cmu.sphinx.util.props.PropertyException; //导入依赖的package包/类
@Override
public void newProperties(PropertySheet ps) throws PropertyException {
    super.newProperties(ps);
    int frameLengthMs = ps.getInt(PROP_FRAME_LENGTH_MS);
    frameLengthSec = ((float) frameLengthMs) / 1000.f;

    adjustment = ps.getDouble(PROP_ADJUSTMENT);
    threshold = ps.getDouble(PROP_THRESHOLD);
    minSignal = ps.getDouble(PROP_MIN_SIGNAL);

    logger = ps.getLogger();
    //logger.setLevel(Level.FINEST);
 
    initialize();
}
 
开发者ID:juanma2268,项目名称:jumbertoTeia2600,代码行数:16,代码来源:SpeechClassifier.java

示例11: newProperties

import edu.cmu.sphinx.util.props.PropertyException; //导入依赖的package包/类
@Override
public void newProperties(PropertySheet ps) throws PropertyException {
    super.newProperties(ps);

    startSpeechTime = ps.getInt(PROP_START_SPEECH);
    endSilenceTime = ps.getInt(PROP_END_SILENCE);
    speechLeader = ps.getInt(PROP_SPEECH_LEADER);
    speechLeaderFrames = ps.getInt(PROP_SPEECH_LEADER_FRAMES);
    speechTrailer = ps.getInt(PROP_SPEECH_TRAILER);
    endSilenceDecay = ps.getDouble(PROP_END_SILENCE_DECAY);
    
    initialEndSilenceTime = endSilenceTime;
}
 
开发者ID:juanma2268,项目名称:jumbertoTeia2600,代码行数:14,代码来源:SpeechMarker.java

示例12: newProperties

import edu.cmu.sphinx.util.props.PropertyException; //导入依赖的package包/类
public void newProperties(PropertySheet ps) throws PropertyException {
    super.newProperties(ps);
    baseURL = ConfigurationManagerUtils.getResource(PROP_BASE_GRAMMAR_URL,
            ps);
    logMath = (LogMath) ps.getComponent(PROP_LOG_MATH);
    logger = ps.getLogger();
    grammarName = ps.getString(PROP_GRAMMAR_NAME);
    loadGrammar = true;
}
 
开发者ID:juanma2268,项目名称:jumbertoTeia2600,代码行数:10,代码来源:JSGFGrammar.java

示例13: newProperties

import edu.cmu.sphinx.util.props.PropertyException; //导入依赖的package包/类
@Override
public void newProperties(PropertySheet ps) throws PropertyException {
    logger = ps.getLogger();

    wordDictionaryFile = ConfigurationManagerUtils.getResource(PROP_DICTIONARY, ps);
    fillerDictionaryFile = ConfigurationManagerUtils.getResource(PROP_FILLER_DICTIONARY, ps);
    addendaUrlList = ps.getResourceList(PROP_ADDENDA);
    addSilEndingPronunciation = ps.getBoolean(PROP_ADD_SIL_ENDING_PRONUNCIATION);
    wordReplacement = ps.getString(Dictionary.PROP_WORD_REPLACEMENT);
    allowMissingWords = ps.getBoolean(Dictionary.PROP_ALLOW_MISSING_WORDS);
    createMissingWords = ps.getBoolean(PROP_CREATE_MISSING_WORDS);
    unitManager = (UnitManager) ps.getComponent(PROP_UNIT_MANAGER);
}
 
开发者ID:juanma2268,项目名称:jumbertoTeia2600,代码行数:14,代码来源:FullDictionary.java

示例14: newProperties

import edu.cmu.sphinx.util.props.PropertyException; //导入依赖的package包/类
@Override
public void newProperties(PropertySheet ps) throws PropertyException {
    // get acoustic model configuration data from the sphinx
    // properties

    init(ps.getInt(LEFT_CONTEXT_SIZE),ps.getInt(RIGHT_CONTEXT_SIZE));

}
 
开发者ID:juanma2268,项目名称:jumbertoTeia2600,代码行数:9,代码来源:TrivialAcousticModel.java

示例15: newProperties

import edu.cmu.sphinx.util.props.PropertyException; //导入依赖的package包/类
@Override
public void newProperties(PropertySheet ps) throws PropertyException {

    if (allocated) {
        throw new RuntimeException("Can't change properties after allocation");
    }
    host = ps.getString(PROP_HOST);
    port = ps.getInt(PROP_PORT);
    location = ConfigurationManagerUtils.getResource(PROP_LOCATION, ps);
    logMath = (LogMath) ps.getComponent(PROP_LOG_MATH);

    maxDepth = ps.getInt(PROP_MAX_DEPTH);
    if (maxDepth == -1)
        maxDepth = 3;
}
 
开发者ID:juanma2268,项目名称:jumbertoTeia2600,代码行数:16,代码来源:NetworkLanguageModel.java


注:本文中的edu.cmu.sphinx.util.props.PropertyException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。