示例#1
0
		/// <summary>
		/// Break an occurrence that is a phrase into its constituent wordforms.
		/// </summary>
		public void BreakPhrase()
		{
			using (var pp = new ParagraphParser(Paragraph))
			{
				// This is a new paragraph parser, and we haven't set up any pre-existing analyses, so it doesn't matter
				// what we pass for cWfAnalysisPrev.
				IList<IAnalysis> wordforms = pp.CollectSegmentForms(GetMyBeginOffsetInPara(), GetMyEndOffsetInPara(), 0, false);
				if (wordforms.Count > 1)
				{
					var oldWordform = Analysis.Wordform;
					Segment.AnalysesRS.Replace(Index, 1, wordforms.Cast<ICmObject>());
					// Enhance JohnT: for this sort of automatic deletion, I wonder whether we should make
					// stronger checks, such as that it has no analysis or glosses?
					DeleteWordformIfPossible(oldWordform);
				}
			}
		}