Esempio n. 1
0
			/// <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;
			}
Esempio n. 2
0
			/// <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;
			}