本文整理匯總了C#中Alignment.ToSoundContext方法的典型用法代碼示例。如果您正苦於以下問題:C# Alignment.ToSoundContext方法的具體用法?C# Alignment.ToSoundContext怎麽用?C# Alignment.ToSoundContext使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Alignment
的用法示例。
在下文中一共展示了Alignment.ToSoundContext方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: IsRegular
private bool IsRegular(WordPair wordPair, IWordAlignerResult alignerResult, Alignment<Word, ShapeNode> alignment, int column, Ngram<Segment> v)
{
VarietyPair vp = wordPair.VarietyPair;
SoundContext context = alignment.ToSoundContext(_segmentPool, 0, column, alignerResult.WordAligner.ContextualSoundClasses);
FrequencyDistribution<Ngram<Segment>> freqDist = vp.CognateSoundCorrespondenceFrequencyDistribution[context];
int threshold;
if (_automaticRegularCorrespondenceThreshold)
{
int seg2Count = vp.CognateSoundCorrespondenceFrequencyDistribution.Conditions.Where(sc => sc.LeftEnvironment == context.LeftEnvironment && sc.RightEnvironment == context.RightEnvironment)
.Sum(sc => vp.CognateSoundCorrespondenceFrequencyDistribution[sc][v]);
if (!_regularCorrespondenceThresholdTable.TryGetThreshold(vp.CognateCount, freqDist.SampleOutcomeCount, seg2Count, out threshold))
threshold = _defaultRegularCorrepondenceThreshold;
}
else
{
threshold = _defaultRegularCorrepondenceThreshold;
}
return freqDist[v] >= threshold;
}