public void SparseAnalyses_SimpleEdits_SimpleSegmentParagraph_DuplicateWordforms_AddWhitespace_LT5313() { // First set sparse analyses on wordforms that have multiple occurrences. ParagraphBuilder pb = new ParagraphBuilder(m_textsDefn, m_text1, (int)Text1ParaIndex.SimpleSegmentPara); pb.ParseParagraph(); ParagraphAnnotatorForParagraphBuilder tapb = new ParagraphAnnotatorForParagraphBuilder(pb); string gloss; var gloss0_1 = tapb.SetDefaultWordGloss(0, 1, out gloss); // xxxyalola 1 var gloss1_1 = tapb.SetDefaultWordGloss(1, 1, out gloss); // xxxpus 2 var gloss2_1 = tapb.SetDefaultWordGloss(2, 1, out gloss); // xxxnihimbilira 3 tapb.ValidateAnnotations(); // precondition testing. // Append whitespace in the text, and see if the analyses still show up in the right place // (cf. LT-5313). pb.ReplaceTrailingWhitepace(0, 0, 1); pb.RebuildParagraphContentFromAnnotations(); pb.ParseParagraph(); Assert.AreEqual(gloss0_1, tapb.GetAnalysis(0, 1)); Assert.AreEqual(gloss1_1, tapb.GetAnalysis(1, 1)); Assert.AreEqual(gloss2_1, tapb.GetAnalysis(2, 1)); tapb.ValidateAnnotations(); }
public void SparseTwficAnalyses_SimpleEdits_SimpleSegmentParagraph_DuplicateWordforms_AddWhitespace_LT5313() { CheckDisposed(); // First set sparse analyses on wordforms that have multiple occurrences. ParagraphBuilder pb = new ParagraphBuilder(m_textsDefn, m_text1, (int)Text1ParaIndex.SimpleSegmentPara); ParagraphAnnotatorForParagraphBuilder tapb = new ParagraphAnnotatorForParagraphBuilder(pb); tapb.SetDefaultWordGloss("xxxyalola", 0); // gloss first occurrence. tapb.SetDefaultWordGloss("xxxpus", 1); // gloss second occurrence. tapb.SetDefaultWordGloss("xxxnihimbilira", 2); // gloss third occurrence. tapb.ValidateAnnotations(); // Append whitespace in the text, and see if the analyses still show up in the right place // (cf. LT-5313). pb.ReplaceTrailingWhitepace(0, 0, 1); pb.RebuildParagraphContentFromAnnotations(); tapb.ValidateAnnotations(); }