本文整理汇总了C#中ILexEntry.CreateVariantEntryAndBackRef方法的典型用法代码示例。如果您正苦于以下问题:C# ILexEntry.CreateVariantEntryAndBackRef方法的具体用法?C# ILexEntry.CreateVariantEntryAndBackRef怎么用?C# ILexEntry.CreateVariantEntryAndBackRef使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ILexEntry
的用法示例。
在下文中一共展示了ILexEntry.CreateVariantEntryAndBackRef方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetVariantOf
/// <summary>
/// create a variant and link it to the given leMain entry
/// and confirm this analysis on the given (monomorphemic) cba.
/// </summary>
/// <param name="iSegment"></param>
/// <param name="iSegForm"></param>
/// <param name="leMain"></param>
/// <param name="variantType"></param>
/// <returns>hvo of the resulting LexEntryRef</returns>
virtual public ILexEntryRef SetVariantOf(int iSegment, int iSegForm, ILexEntry leMain, ILexEntryType variantType)
{
if (variantType == null)
throw new ArgumentNullException("requires non-null variantType parameter.");
// for now, just create the variant entry and the variant of target, treating the wordform as monomorphemic.
ITsString tssVariantLexemeForm = GetBaselineText(iSegment, iSegForm);
ILexEntryRef ler = leMain.CreateVariantEntryAndBackRef(variantType, tssVariantLexemeForm);
ILexEntry variant = ler.Owner as ILexEntry;
ArrayList morphs = new ArrayList(1);
morphs.Add(variant.LexemeFormOA);
BreakIntoMorphs(iSegment, iSegForm, morphs);
ILexEntry mainEntry;
ILexSense mainSense;
MorphServices.GetMainEntryAndSenseStack(ler.ComponentLexemesRS.First() as IVariantComponentLexeme, out mainEntry, out mainSense);
SetMorphSense(iSegment, iSegForm, 0, mainSense);
return ler;
}
示例2: SetVariantOf
/// <summary>
/// create a variant and link it to the given leMain entry
/// and confirm this analysis on the given (monomorphemic) cba.
/// </summary>
/// <param name="iSegment"></param>
/// <param name="iSegForm"></param>
/// <param name="leMain"></param>
/// <param name="variantTypeRevAbbr"></param>
/// <returns>hvo of the resulting LexEntryRef</returns>
virtual internal ILexEntryRef SetVariantOf(int iSegment, int iSegForm, ILexEntry leMain, string variantTypeRevAbbr)
{
ILexEntryType variantType = null;
foreach (ILexEntryType let in m_cache.LangProject.LexDbOA.VariantEntryTypesOA.ReallyReallyAllPossibilities)
{
if (let.ReverseAbbr.AnalysisDefaultWritingSystem == variantTypeRevAbbr)
{
variantType = let;
break;
}
}
// for now, just create the variant entry and the variant of target, treating the wordform as monomorphemic.
int hvoCbaActual = GetSegmentForm(iSegment, iSegForm);
ITsString tssVariantLexemeForm = GetBaselineText(hvoCbaActual);
ILexEntryRef ler = leMain.CreateVariantEntryAndBackRef(variantType, tssVariantLexemeForm);
ILexEntry variant = (ler as LexEntryRef).Owner as ILexEntry;
ArrayList morphs = new ArrayList(1);
morphs.Add(variant.LexemeFormOA);
BreakIntoMorphs(iSegment, iSegForm, morphs);
return ler;
}