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


C# AnalysisOccurrence.GetMyBeginOffsetInPara方法代码示例

本文整理汇总了C#中SIL.FieldWorks.FDO.DomainServices.AnalysisOccurrence.GetMyBeginOffsetInPara方法的典型用法代码示例。如果您正苦于以下问题:C# AnalysisOccurrence.GetMyBeginOffsetInPara方法的具体用法?C# AnalysisOccurrence.GetMyBeginOffsetInPara怎么用?C# AnalysisOccurrence.GetMyBeginOffsetInPara使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SIL.FieldWorks.FDO.DomainServices.AnalysisOccurrence的用法示例。


在下文中一共展示了AnalysisOccurrence.GetMyBeginOffsetInPara方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CallGetWordGroupCellsBorderingChOrph

		internal void CallGetWordGroupCellsBorderingChOrph(AnalysisOccurrence occurrence,
			out ChartLocation precCell, out ChartLocation follCell)
		{
			var iPara = m_ccl.CallGetParaIndexForOccurrence(occurrence);
			Assert.Greater(iPara, -1, "Can't get ChOrph paragraph index.");
			var offset = occurrence.GetMyBeginOffsetInPara();
			Assert.Greater(offset, -1, "Can't get ChOrph offset.");
			m_ccl.GetWordGroupCellsBorderingChOrph(iPara, offset, out precCell, out follCell);
		}
开发者ID:sillsdev,项目名称:FieldWorks,代码行数:9,代码来源:ConstituentChartDatabaseTests.cs

示例2: FindWhereAddChOrph_MultiWordGroups_SurroundLoc

		public void FindWhereAddChOrph_MultiWordGroups_SurroundLoc()
		{
			var para1 = MakeParagraphSpecificContent("Five very wild wordforms here.");
			var seg1 = para1.SegmentsOS[0];
			var w0 = new AnalysisOccurrence(seg1, 0); // Five
			var w1 = new AnalysisOccurrence(seg1, 1); // very
			var w2 = new AnalysisOccurrence(seg1, 2); // wild
			var w3 = new AnalysisOccurrence(seg1, 3); // wordforms
			var w4 = new AnalysisOccurrence(seg1, 4); // here

			// Chart most words
			// I just made an arbitrary set of more-or-less reasonable chart cells.
			var row1 = m_helper.MakeFirstRow();
			var wg1_1 = MakeWordGroup(row1, 1, w0, w1);
			// Left w2 uncharted
			MakeWordGroup(row1, 1, w3, w3);
			MakeWordGroup(row1, 4, w4, w4); // leaves nothing in Ribbon, except ChOrph
			// This tests what happens if we try to put the ChOrph in column index 1.
			var testCell = m_ccl.MakeLocObj(1, row1);

			int whereToInsertActual;
			IConstChartWordGroup existingWordGroupActual;

			// SUT; icol of WordGroup in question = 1, iPara of ChOrph = 0
			var result = m_ccl.FindWhereToAddChOrph(testCell, 0, w2.GetMyBeginOffsetInPara(),
				out whereToInsertActual, out existingWordGroupActual);

			// Test results
			Assert.AreEqual(ConstituentChartLogic.FindWhereToAddResult.kAppendToExisting, result);
			Assert.AreEqual(wg1_1.Hvo, existingWordGroupActual.Hvo);
		}
开发者ID:sillsdev,项目名称:FieldWorks,代码行数:31,代码来源:ConstituentChartDatabaseTests.cs

示例3: FindWhereAddChOrph_InsertBeforeLaterPara

		public void FindWhereAddChOrph_InsertBeforeLaterPara()
		{
			var para1 = MakeParagraphSpecificContent("Five very wild wordforms here.");
			var para2 = MakeParagraphSpecificContent("Entirely different words.");
			var seg1 = para1.SegmentsOS[0];
			var seg2 = para2.SegmentsOS[0];
			var w0 = new AnalysisOccurrence(seg1, 0); // Five
			var w1 = new AnalysisOccurrence(seg1, 1); // very
			var w2 = new AnalysisOccurrence(seg1, 2); // wild
			var w3 = new AnalysisOccurrence(seg1, 3); // wordforms
			var w4 = new AnalysisOccurrence(seg1, 4); // here
			var w5 = new AnalysisOccurrence(seg2, 0); // Entirely
			var w6 = new AnalysisOccurrence(seg2, 1); // different
			var w7 = new AnalysisOccurrence(seg2, 2); // words

			// Chart most words
			// I just made an arbitrary set of more-or-less reasonable chart cells.
			var row1 = m_helper.MakeFirstRow();
			var row2 = m_helper.MakeSecondRow();
			MakeWordGroup(row1, 1, w0, w1);
			MakeWordGroup(row1, 2, w2, w3);
			var wg2_0 = MakeWordGroup(row2, 0, w5, w6); // Left w4 uncharted
			MakeWordGroup(row2, 3, w7, w7);
			var testCell = m_ccl.MakeLocObj(0, row2);

			int whereToInsertActual;
			IConstChartWordGroup existingWordGroupActual;

			// SUT; icol of WordGroup in question = 0, iPara of ChOrph = 0
			var result = m_ccl.FindWhereToAddChOrph(testCell, 0, w4.GetMyBeginOffsetInPara(),
				out whereToInsertActual, out existingWordGroupActual);

			// Test results
			Assert.AreEqual(ConstituentChartLogic.FindWhereToAddResult.kInsertChOrphInWordGrp, result);
			Assert.AreEqual(0, whereToInsertActual);
			Assert.AreEqual(wg2_0.Hvo, existingWordGroupActual.Hvo);
		}
开发者ID:sillsdev,项目名称:FieldWorks,代码行数:37,代码来源:ConstituentChartDatabaseTests.cs

示例4: FindWhereAddChOrph_AppendByPara

		public void FindWhereAddChOrph_AppendByPara()
		{
			var para1 = MakeParagraphSpecificContent("Three wordforms here.");
			var para2 = MakeParagraphSpecificContent("Entirely different words.");
			var seg1 = para1.SegmentsOS[0];
			var seg2 = para2.SegmentsOS[0];
			var w0 = new AnalysisOccurrence(seg1, 0); // Three
			var w1 = new AnalysisOccurrence(seg1, 1); // wordforms
			var w2 = new AnalysisOccurrence(seg1, 2); // here
			var w3 = new AnalysisOccurrence(seg2, 0); // Entirely
			var w4 = new AnalysisOccurrence(seg2, 1); // different

			// Chart most words
			// I just made an arbitrary set of more-or-less reasonable chart cells.
			var row1 = m_helper.MakeFirstRow();
			var row2 = m_helper.MakeSecondRow();
			MakeWordGroup(row1, 1, w0, w0);
			var wg1_2 = MakeWordGroup(row1, 2, w1, w2); // Left w3 uncharted
			MakeWordGroup(row2, 0, w4, w4); // Leaves 1 wordform uncharted (in the ribbon)
			var testCell = m_ccl.MakeLocObj(2, row1);

			int whereToInsertActual;
			IConstChartWordGroup existingWordGroupActual;

			// SUT; icol of WordGroup in question = 2, iPara of ChOrph = 1
			var result = m_ccl.FindWhereToAddChOrph(testCell, 1, w3.GetMyBeginOffsetInPara(),
				out whereToInsertActual, out existingWordGroupActual);

			// Test results
			Assert.AreEqual(ConstituentChartLogic.FindWhereToAddResult.kAppendToExisting, result,
				"Wrong enum result.");
			Assert.AreEqual(2, whereToInsertActual, "The index whereToInsert is wrong.");
			Assert.AreEqual(wg1_2.Hvo, existingWordGroupActual.Hvo, "Wrong WordGroup.");
		}
开发者ID:sillsdev,项目名称:FieldWorks,代码行数:34,代码来源:ConstituentChartDatabaseTests.cs


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