コード例 #1
0
ファイル: BtConverterTests.cs プロジェクト: sillsdev/WorldPad
 void VerifyEquality(string first, string second, bool equal, ILgCharacterPropertyEngine cpe, string label)
 {
     Assert.AreEqual(equal, BtConverter.StringsEqualExceptSpace(first, second, cpe), label + " - forward");
     Assert.AreEqual(equal, BtConverter.StringsEqualExceptSpace(second, first, cpe), label + " - backward");
     Assert.AreEqual(true, BtConverter.StringsEqualExceptSpace(first, first, cpe), label + " - first to self");
     Assert.AreEqual(true, BtConverter.StringsEqualExceptSpace(second, second, cpe), label + " - second to self");
 }
コード例 #2
0
ファイル: BtConverterTests.cs プロジェクト: sillsdev/WorldPad
        public void MatchingVerses()
        {
            // Make a paragraph where both para contents and translation have two segments separated by verse number.
            string     paraContents1 = "Das buch ist rot. ";
            string     verse         = "12";
            string     paraContents2 = "Das Madchen ist shon.";
            ITsStrBldr bldr          = m_tsf.MakeString(paraContents1 + verse + paraContents2, m_wsVern).GetBldr();

            bldr.SetStrPropValue(paraContents1.Length, paraContents1.Length + verse.Length, (int)FwTextPropType.ktptNamedStyle,
                                 ScrStyleNames.VerseNumber);
            m_para.Contents.UnderlyingTsString = bldr.GetString();
            string trans1 = "The book is red.";
            string trans2 = "The girl is beautiful";

            bldr = m_tsf.MakeString(trans1 + verse + trans2, m_wsTrans).GetBldr();
            bldr.SetStrPropValue(trans1.Length, trans1.Length + verse.Length, (int)FwTextPropType.ktptNamedStyle,
                                 ScrStyleNames.VerseNumber);
            m_trans.Translation.SetAlternative(bldr.GetString(), m_wsTrans);

            BtConverter converter = new BtConverter(m_para);

            converter.ConvertCmTransToInterlin(m_wsTrans);
            int cseg = Cache.GetVectorSize(m_para.Hvo, kflidSegments);

            Assert.AreEqual(3, cseg, "parsing para should produce three segs.");
            VerifyFt(0, trans1, "first seg");
            // Currently we don't care whether there is an FT for verse segments...maybe one day we will.
            //VerifyFt(1, null, "no second FT");
            VerifyFt(2, trans2, "last seg");
        }
コード例 #3
0
ファイル: BtConverterTests.cs プロジェクト: sillsdev/WorldPad
        public void ChapterAndWhiteSpace()
        {
            // Here we have chapter number as well as verse number, and white space that could throw things off.
            //string pc1 = "Das buch ist rot. ";
            //string pc2 = "Das Madchen ist shon.";
            string chap1  = "1";
            string verse1 = "9";
            string pc3    = "Der Herr ist gross.";
            string pc4    = "Ich spreche nicht viel Deutsch.";
            string verse2 = "10";
            string pc5    = "Was is das?";
            string pc6    = "Wie gehts?";

            ITsStrBldr bldr = m_tsf.MakeString(" " + chap1 + " " + verse1 + pc3 + pc4 + verse2 + pc5 + pc6, m_wsVern).GetBldr();

            bldr.SetStrPropValue(1, chap1.Length, (int)FwTextPropType.ktptNamedStyle,
                                 ScrStyleNames.ChapterNumber);
            bldr.SetStrPropValue(1 + chap1.Length + 1, 1 + chap1.Length + 1 + verse1.Length, (int)FwTextPropType.ktptNamedStyle,
                                 ScrStyleNames.VerseNumber);
            int ichEndV1 = 1 + chap1.Length + 1 + verse1.Length + pc3.Length + pc4.Length;

            bldr.SetStrPropValue(ichEndV1, ichEndV1 + verse2.Length, (int)FwTextPropType.ktptNamedStyle,
                                 ScrStyleNames.VerseNumber);
            m_para.Contents.UnderlyingTsString = bldr.GetString();
            //string trans1 = "The book is red.";
            //string trans2 = "The girl is beautiful";
            string trans3 = "The man is big.";
            //string trans4 = "I don't speak much German.";
            string trans5 = "What is that?";
            string trans6 = "How's it going?";

            bldr = m_tsf.MakeString(chap1 + verse1 + " " + trans3 + verse2 + " " + trans5 + trans6, m_wsTrans).GetBldr();
            bldr.SetStrPropValue(0, chap1.Length, (int)FwTextPropType.ktptNamedStyle,
                                 ScrStyleNames.ChapterNumber);
            bldr.SetStrPropValue(chap1.Length, chap1.Length + verse1.Length,
                                 (int)FwTextPropType.ktptNamedStyle, ScrStyleNames.VerseNumber);
            int ichEndTransV1 = chap1.Length + verse1.Length + 1 + trans3.Length;

            bldr.SetStrPropValue(ichEndTransV1, ichEndTransV1 + verse2.Length, (int)FwTextPropType.ktptNamedStyle,
                                 ScrStyleNames.VerseNumber);
            m_trans.Translation.SetAlternative(bldr.GetString(), m_wsTrans);

            BtConverter converter = new BtConverter(m_para);

            converter.ConvertCmTransToInterlin(m_wsTrans);
            int cseg = Cache.GetVectorSize(m_para.Hvo, kflidSegments);

            Assert.AreEqual(6, cseg, "parsing para should produce six segs.");
            VerifyLabel(0, "chap/verse number identified as label");
            VerifyFt(1, trans3, "2nd seg should have corresponding BT");
            VerifyFt(2, null, "3rd seg should have no BT");
            VerifyLabel(3, "verse number identified as label");
            VerifyFt(4, trans5, "5th seg should get third BT");
            VerifyFt(5, trans6, "last seg gets appropriate BT");
        }
コード例 #4
0
ファイル: BtConverterTests.cs プロジェクト: sillsdev/WorldPad
        public void VersesOutOfOrder()
        {
            // Here for some reason the BT is out of order: has verse 10 before verse 9. The program still assigns
            // sequentially the segments that follow matching verse numbers.
            string pc1    = "Das buch ist rot. ";
            string pc2    = "Das Madchen ist shon.";
            string verse1 = "9";
            string pc3    = "Der Herr ist gross.";
            string pc4    = "Ich spreche nicht viel Deutsch.";
            string verse2 = "10";
            string pc5    = "Was is das?";
            string pc6    = "Wie gehts?";

            ITsStrBldr bldr = m_tsf.MakeString(pc1 + pc2 + verse1 + pc3 + pc4 + verse2 + pc5 + pc6, m_wsVern).GetBldr();

            bldr.SetStrPropValue(pc1.Length + pc2.Length, pc1.Length + pc2.Length + verse1.Length, (int)FwTextPropType.ktptNamedStyle,
                                 ScrStyleNames.VerseNumber);
            int ichEndV1 = pc1.Length + pc2.Length + verse1.Length + pc3.Length + pc4.Length;

            bldr.SetStrPropValue(ichEndV1, ichEndV1 + verse2.Length, (int)FwTextPropType.ktptNamedStyle,
                                 ScrStyleNames.VerseNumber);
            m_para.Contents.UnderlyingTsString = bldr.GetString();
            string trans1 = "The book is red.";
            string trans2 = "The girl is beautiful";
            string trans3 = "The man is big.";
            string trans4 = "I don't speak much German.";
            string trans5 = "What is that?";
            string trans6 = "How's it going?";

            bldr = m_tsf.MakeString(trans1 + trans2 + verse2 + trans5 + trans6 + verse1 + trans3 + trans4, m_wsTrans).GetBldr();
            bldr.SetStrPropValue(trans1.Length + trans2.Length, trans1.Length + trans2.Length + verse2.Length,
                                 (int)FwTextPropType.ktptNamedStyle, ScrStyleNames.VerseNumber);
            int ichEndTransV1 = trans1.Length + trans2.Length + verse2.Length + trans5.Length + trans6.Length;

            bldr.SetStrPropValue(ichEndTransV1, ichEndTransV1 + verse1.Length, (int)FwTextPropType.ktptNamedStyle,
                                 ScrStyleNames.VerseNumber);
            m_trans.Translation.SetAlternative(bldr.GetString(), m_wsTrans);

            BtConverter converter = new BtConverter(m_para);

            converter.ConvertCmTransToInterlin(m_wsTrans);
            int cseg = Cache.GetVectorSize(m_para.Hvo, kflidSegments);

            Assert.AreEqual(8, cseg, "parsing para should produce eight segs.");
            VerifyFt(0, trans1, "first seg");
            VerifyFt(1, trans2, "2nd seg assigned sequentially");
            //VerifyFt(2, null, "no trans of verse number");
            VerifyFt(3, trans3, "3rd seg should get re-ordered trans from correct verse");
            VerifyFt(4, trans4, "4th seg also reordered");
            //VerifyFt(5, null, "no trans of verse number");
            VerifyFt(6, trans5, "5th seg should get third BT");
            VerifyFt(7, trans6, "last seg gets appropriate BT");
        }
コード例 #5
0
ファイル: BtConverterTests.cs プロジェクト: sillsdev/WorldPad
        public void ExtraSegsInBtVerseNotMatching()
        {
            // Like ExtraSegsInBt, but second verse number does not match in BT.
            string pc1    = "Das buch ist rot. ";
            string pc2    = "Das Madchen ist shon.";
            string verse1 = "9";
            string pc3    = "Der Herr ist gross.";
            string pc4    = "Ich spreche nicht viel Deutsch.";
            string verse2 = "10";
            string pc5    = "Was is das?";
            string pc6    = "Wie gehts?";
            string verse3 = "11";

            ITsStrBldr bldr = m_tsf.MakeString(pc1 + pc2 + verse1 + pc3 + pc4 + verse2 + pc5 + pc6, m_wsVern).GetBldr();

            bldr.SetStrPropValue(pc1.Length + pc2.Length, pc1.Length + pc2.Length + verse1.Length, (int)FwTextPropType.ktptNamedStyle,
                                 ScrStyleNames.VerseNumber);
            int ichEndV1 = pc1.Length + pc2.Length + verse1.Length + pc3.Length + pc4.Length;

            bldr.SetStrPropValue(ichEndV1, ichEndV1 + verse2.Length, (int)FwTextPropType.ktptNamedStyle,
                                 ScrStyleNames.VerseNumber);
            m_para.Contents.UnderlyingTsString = bldr.GetString();
            string trans1 = "The book is red.";
            //string trans2 = "The girl is beautiful";
            string trans3 = "The man is big.";
            // string trans4 = "I don't speak much German.";
            string trans5 = "What is that?";

            // string trans6 = "How's it going?";
            bldr = m_tsf.MakeString(trans1 + verse1 + trans3 + verse3 + trans5, m_wsTrans).GetBldr();
            bldr.SetStrPropValue(trans1.Length, trans1.Length + verse1.Length, (int)FwTextPropType.ktptNamedStyle,
                                 ScrStyleNames.VerseNumber);
            int ichEndTransV1 = trans1.Length + verse1.Length + trans3.Length;

            bldr.SetStrPropValue(ichEndTransV1, ichEndTransV1 + verse3.Length, (int)FwTextPropType.ktptNamedStyle,
                                 ScrStyleNames.VerseNumber);
            m_trans.Translation.SetAlternative(bldr.GetString(), m_wsTrans);

            BtConverter converter = new BtConverter(m_para);

            converter.ConvertCmTransToInterlin(m_wsTrans);
            int cseg = Cache.GetVectorSize(m_para.Hvo, kflidSegments);

            Assert.AreEqual(8, cseg, "parsing para should produce eight segs.");
            VerifyFt(0, trans1, "first seg");
            VerifyFt(1, null, "verse number sync should keep second BT empty");
            //VerifyFt(2, null, "no trans of verse number");
            VerifyFt(3, trans3, "3rd seg should get second BT");
            VerifyFt(4, trans5, "2nd verse does not match, keep assigning sequentially");
            //VerifyFt(5, null, "no trans of verse number");
            VerifyFt(6, null, "5th seg has no BTs left to assign");
            VerifyFt(7, null, "last seg left with empty BT");
        }
コード例 #6
0
ファイル: BtConverterTests.cs プロジェクト: sillsdev/WorldPad
        public void NothingAtStartOfBt()
        {
            // Here there is extra material in the paragraph before the first verse number, but not in the BT.
            string pc1    = "Das buch ist rot. ";
            string pc2    = "Das Madchen ist shon.";
            string verse1 = "9";
            string pc3    = "Der Herr ist gross.";
            string pc4    = "Ich spreche nicht viel Deutsch.";
            string verse2 = "10";
            string pc5    = "Was is das?";
            string pc6    = "Wie gehts?";

            ITsStrBldr bldr = m_tsf.MakeString(pc1 + pc2 + verse1 + pc3 + pc4 + verse2 + pc5 + pc6, m_wsVern).GetBldr();

            bldr.SetStrPropValue(pc1.Length + pc2.Length, pc1.Length + pc2.Length + verse1.Length, (int)FwTextPropType.ktptNamedStyle,
                                 ScrStyleNames.VerseNumber);
            int ichEndV1 = pc1.Length + pc2.Length + verse1.Length + pc3.Length + pc4.Length;

            bldr.SetStrPropValue(ichEndV1, ichEndV1 + verse2.Length, (int)FwTextPropType.ktptNamedStyle,
                                 ScrStyleNames.VerseNumber);
            m_para.Contents.UnderlyingTsString = bldr.GetString();
            //string trans1 = "The book is red.";
            //string trans2 = "The girl is beautiful";
            string trans3 = "The man is big.";
            string trans4 = "I don't speak much German.";
            string trans5 = "What is that?";
            string trans6 = "How's it going?";

            bldr = m_tsf.MakeString(verse1 + trans3 + trans4 + verse2 + trans5 + trans6, m_wsTrans).GetBldr();
            bldr.SetStrPropValue(0, verse1.Length,
                                 (int)FwTextPropType.ktptNamedStyle, ScrStyleNames.VerseNumber);
            int ichEndTransV1 = verse1.Length + trans3.Length + trans4.Length;

            bldr.SetStrPropValue(ichEndTransV1, ichEndTransV1 + verse2.Length, (int)FwTextPropType.ktptNamedStyle,
                                 ScrStyleNames.VerseNumber);
            m_trans.Translation.SetAlternative(bldr.GetString(), m_wsTrans);

            BtConverter converter = new BtConverter(m_para);

            converter.ConvertCmTransToInterlin(m_wsTrans);
            int cseg = Cache.GetVectorSize(m_para.Hvo, kflidSegments);

            Assert.AreEqual(8, cseg, "parsing para should produce eight segs.");
            VerifyFt(0, null, "first leading seg should have nothing");
            VerifyFt(1, null, "2nd leading seg should have nothing");
            //VerifyFt(2, null, "no trans of verse number");
            VerifyFt(3, trans3, "3rd seg should get normal stuff");
            VerifyFt(4, trans4, "4th seg also reordered");
            //VerifyFt(5, null, "no trans of verse number");
            VerifyFt(6, trans5, "5th seg should get third BT");
            VerifyFt(7, trans6, "last seg gets appropriate BT");
        }
コード例 #7
0
ファイル: BtConverterTests.cs プロジェクト: sillsdev/WorldPad
        public void EmptyPara()
        {
            string paraContents = "";
            string trans        = "";

            m_para.Contents.UnderlyingTsString = m_tsf.MakeString(paraContents, m_wsVern);
            m_trans.Translation.SetAlternative(trans, m_wsTrans);
            BtConverter converter = new BtConverter(m_para);

            converter.ConvertCmTransToInterlin(m_wsTrans);
            int cseg = Cache.GetVectorSize(m_para.Hvo, kflidSegments);

            Assert.AreEqual(0, cseg, "Empty para should have no segments");
        }
コード例 #8
0
ファイル: BtConverterTests.cs プロジェクト: sillsdev/WorldPad
        public void ExtraSegsInParaVerseNotMatching()
        {
            // Make a paragraph where para contents has three verses with one seg each, BT has two segs per verse.
            string pc1 = "Das buch ist rot. ";
            //string pc2 = "Das Madchen ist shon.";
            string verse1 = "9";
            string pc3    = "Der Herr ist gross.";
            //string pc4 = "Ich spreche nicht viel Deutsch.";
            string verse2 = "10";
            string pc5    = "Was is das?";
            //string pc6 = "Wie gehts?";
            string verse3 = "11";

            ITsStrBldr bldr = m_tsf.MakeString(pc1 + verse1 + pc3 + verse2 + pc5, m_wsVern).GetBldr();

            bldr.SetStrPropValue(pc1.Length, pc1.Length + verse1.Length, (int)FwTextPropType.ktptNamedStyle,
                                 ScrStyleNames.VerseNumber);
            int ichEndV1 = pc1.Length + verse1.Length + pc3.Length;

            bldr.SetStrPropValue(ichEndV1, ichEndV1 + verse2.Length, (int)FwTextPropType.ktptNamedStyle,
                                 ScrStyleNames.VerseNumber);
            m_para.Contents.UnderlyingTsString = bldr.GetString();
            string trans1 = "The book is red.";
            string trans2 = "The girl is beautiful";
            string trans3 = "The man is big.";
            string trans4 = "I don't speak much German.";
            string trans5 = "What is that?";
            string trans6 = "How's it going?";

            bldr = m_tsf.MakeString(trans1 + trans2 + verse1 + trans3 + trans4 + verse3 + trans5 + trans6, m_wsTrans).GetBldr();
            bldr.SetStrPropValue(trans1.Length + trans2.Length, trans1.Length + trans2.Length + verse1.Length,
                                 (int)FwTextPropType.ktptNamedStyle, ScrStyleNames.VerseNumber);
            int ichEndTransV1 = trans1.Length + trans2.Length + verse1.Length + trans3.Length + trans4.Length;

            bldr.SetStrPropValue(ichEndTransV1, ichEndTransV1 + verse3.Length, (int)FwTextPropType.ktptNamedStyle,
                                 ScrStyleNames.VerseNumber);
            m_trans.Translation.SetAlternative(bldr.GetString(), m_wsTrans);

            BtConverter converter = new BtConverter(m_para);

            converter.ConvertCmTransToInterlin(m_wsTrans);
            int cseg = Cache.GetVectorSize(m_para.Hvo, kflidSegments);

            Assert.AreEqual(5, cseg, "parsing para should produce five segs.");
            VerifyFt(0, trans1 + " " + trans2, "first seg should have first TWO translations");
            //VerifyFt(1, null, "no trans of verse number");
            VerifyFt(2, trans3, "3rd seg should get next BTs");
            //VerifyFt(3, null, "no trans of verse number");
            VerifyFt(4, trans4 + " " + trans5 + " " + trans6, "5th seg should get last three BTs");
        }
コード例 #9
0
ファイル: BtConverterTests.cs プロジェクト: sillsdev/WorldPad
        public void SingleSegment()
        {
            string paraContents = "Das buch ist rot";
            string trans        = "The book is red";

            m_para.Contents.UnderlyingTsString = m_tsf.MakeString(paraContents, m_wsVern);
            m_trans.Translation.SetAlternative(trans, m_wsTrans);
            BtConverter converter = new BtConverter(m_para);

            converter.ConvertCmTransToInterlin(m_wsTrans);
            int cseg = Cache.GetVectorSize(m_para.Hvo, kflidSegments);

            Assert.AreEqual(1, cseg, "Para with no EOS or verse should have one segment");
            VerifyFt(0, trans, "whole translation should be transferred to single ft.");
        }
コード例 #10
0
ファイル: CmTranslation.cs プロジェクト: vkarthim/liblcm
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Subclasses should override this, if they need to have side effects.
        /// </summary>
        /// <param name="multiAltFlid"></param>
        /// <param name="alternativeWs"></param>
        /// <param name="originalValue"></param>
        /// <param name="newValue"></param>
        /// ------------------------------------------------------------------------------------
        protected override void ITsStringAltChangedSideEffectsInternal(int multiAltFlid,
                                                                       CoreWritingSystemDefinition alternativeWs, ITsString originalValue, ITsString newValue)
        {
            base.ITsStringAltChangedSideEffectsInternal(multiAltFlid, alternativeWs, originalValue, newValue);

            // Make sure the translation belongs to Scripture.
            ScrTxtPara para = Owner as ScrTxtPara;

            if (para == null || TypeRA == null)
            {
                return;
            }

            if (multiAltFlid == CmTranslationTags.kflidTranslation &&
                TypeRA.Guid == CmPossibilityTags.kguidTranBackTranslation &&
                ((originalValue == null && newValue != null) ||
                 (originalValue != null && newValue == null) ||
                 (originalValue != null && originalValue.Text != newValue.Text)))
            {
                BtConverter.ConvertCmTransToInterlin(para, alternativeWs.Handle);
                MarkAsUnfinished(alternativeWs.Handle);
            }
        }
コード例 #11
0
ファイル: BtConverterTests.cs プロジェクト: sillsdev/WorldPad
        public void SmartResync()
        {
            // Here we end up with four segments in the second group. After building it once, we make a change that merges
            // the middle two BT segments. We hope the fourth stays aligned.
            string pc1    = "Das buch ist rot. ";
            string pc2    = "Das Madchen ist shon.";
            string verse1 = "9";
            string pc3    = "Der Herr ist gross.";
            string pc4    = "Ich spreche nicht viel Deutsch.";
            string pc5    = "Was is das?";
            string pc6    = "Wie gehts?";

            ITsStrBldr bldr = m_tsf.MakeString(pc1 + pc2 + verse1 + pc3 + pc4 + pc5 + pc6, m_wsVern).GetBldr();

            bldr.SetStrPropValue(pc1.Length + pc2.Length, pc1.Length + pc2.Length + verse1.Length, (int)FwTextPropType.ktptNamedStyle,
                                 ScrStyleNames.VerseNumber);
            m_para.Contents.UnderlyingTsString = bldr.GetString();
            string trans1 = "The book is red.";
            //string trans2 = "The girl is beautiful";
            string trans3 = "The man is big.";
            string trans4 = "I don't speak much German.";
            string trans5 = "What is that?";
            string trans6 = "How's it going?";

            bldr = m_tsf.MakeString(trans1 + verse1 + trans3 + trans4 + trans5 + trans6, m_wsTrans).GetBldr();
            bldr.SetStrPropValue(trans1.Length, trans1.Length + verse1.Length,
                                 (int)FwTextPropType.ktptNamedStyle, ScrStyleNames.VerseNumber);
            m_trans.Translation.SetAlternative(bldr.GetString(), m_wsTrans);

            BtConverter converter = new BtConverter(m_para);

            converter.ConvertCmTransToInterlin(m_wsTrans);
            int cseg = Cache.GetVectorSize(m_para.Hvo, kflidSegments);

            Assert.AreEqual(7, cseg, "parsing para should produce seven segs.");
            VerifyFt(0, trans1, "first leading seg should have proper trans");
            VerifyFt(1, null, "2nd leading seg should have nothing");
            //VerifyFt(2, null, "no trans of verse number");
            VerifyFt(3, trans3, "4th seg should get normal stuff");
            VerifyFt(4, trans4, "5th seg gets trans in seqyence");
            VerifyFt(5, trans5, "6th seg gets trans in seq");
            VerifyFt(6, trans6, "last seg gets trans in seq");

            // Now, the real test!

            int ichDot = trans1.Length + verse1.Length + trans3.Length + trans4.Length - 1;

            bldr = m_trans.Translation.GetAlternative(m_wsTrans).UnderlyingTsString.GetBldr();
            bldr.ReplaceTsString(ichDot, ichDot + 1, null);
            m_trans.Translation.SetAlternative(bldr.GetString(), m_wsTrans);
            converter = new BtConverter(m_para);
            converter.ConvertCmTransToInterlin(m_wsTrans);

            cseg = Cache.GetVectorSize(m_para.Hvo, kflidSegments);
            Assert.AreEqual(7, cseg, "reparsing para should produce seven segs.");
            VerifyFt(0, trans1, "first leading seg should (still) have proper trans");
            VerifyFt(1, null, "2nd leading seg should (still) have nothing");
            //VerifyFt(2, null, "no trans of verse number");
            VerifyFt(3, trans3, "4th seg should get normal stuff");
            VerifyFt(4, trans4.Substring(0, trans4.Length - 1) + trans5, "4th seg gets blended translations");
            VerifyFt(5, null, "skip 6th seg to keep sixth unchanged");
            VerifyFt(6, trans6, "6th seg is not changed.");
        }
コード例 #12
0
ファイル: BtConverterTests.cs プロジェクト: sillsdev/WorldPad
        public void ExtraSegsInBtWithDiffNumberSystem()
        {
            // Make a paragraph where para contents has three verses with one seg each, BT has two segs per verse.
            string pc1 = "Das buch ist rot. ";
            //string pc2 = "Das Madchen ist shon.";
            string verse1 = "9";
            string pc3    = "Der Herr ist gross.";
            //string pc4 = "Ich spreche nicht viel Deutsch.";
            string verse2 = "10";
            string pc5    = "Was is das?";

            //string pc6 = "Wie gehts?";
            Cache.LangProject.TranslatedScriptureOA.UseScriptDigits = true;
            int oldDigitZero = Cache.LangProject.TranslatedScriptureOA.ScriptDigitZero;

            try
            {
                int charOffset = 2534 - '0';
                Cache.LangProject.TranslatedScriptureOA.ScriptDigitZero = 2534;                 // Bengali
                StringBuilder bldrV = new StringBuilder();
                bldrV.Append((char)('9' + charOffset));
                string verse1V = bldrV.ToString();
                bldrV = new StringBuilder();
                bldrV.Append((char)('1' + charOffset));
                bldrV.Append((char)('0' + charOffset));
                string     verse2V = bldrV.ToString();
                ITsStrBldr bldr    = m_tsf.MakeString(pc1 + verse1V + pc3 + verse2V + pc5, m_wsVern).GetBldr();
                bldr.SetStrPropValue(pc1.Length, pc1.Length + verse1V.Length, (int)FwTextPropType.ktptNamedStyle,
                                     ScrStyleNames.VerseNumber);
                int ichEndV1 = pc1.Length + verse1V.Length + pc3.Length;
                bldr.SetStrPropValue(ichEndV1, ichEndV1 + verse2V.Length, (int)FwTextPropType.ktptNamedStyle,
                                     ScrStyleNames.VerseNumber);
                m_para.Contents.UnderlyingTsString = bldr.GetString();
                string trans1 = "The book is red.";
                string trans2 = "The girl is beautiful";
                string trans3 = "The main is big.";
                string trans4 = "I don't speak much German.";
                string trans5 = "What is that?";
                string trans6 = "How's it going?";
                bldr =
                    m_tsf.MakeString(trans1 + trans2 + verse1 + trans3 + trans4 + verse2 + trans5 + trans6, m_wsTrans).
                    GetBldr();
                bldr.SetStrPropValue(trans1.Length + trans2.Length, trans1.Length + trans2.Length + verse1.Length,
                                     (int)FwTextPropType.ktptNamedStyle, ScrStyleNames.VerseNumber);
                int ichEndTransV1 = trans1.Length + trans2.Length + verse1.Length + trans3.Length + trans4.Length;
                bldr.SetStrPropValue(ichEndTransV1, ichEndTransV1 + verse2.Length, (int)FwTextPropType.ktptNamedStyle,
                                     ScrStyleNames.VerseNumber);
                m_trans.Translation.SetAlternative(bldr.GetString(), m_wsTrans);

                BtConverter converter = new BtConverter(m_para);
                converter.ConvertCmTransToInterlin(m_wsTrans);
                int cseg = Cache.GetVectorSize(m_para.Hvo, kflidSegments);
                Assert.AreEqual(5, cseg, "parsing para should produce five segs.");
                VerifyFt(0, trans1 + " " + trans2, "first seg should have first TWO translations");
                //VerifyFt(1, null, "no trans of verse number");
                VerifyFt(2, trans3 + " " + trans4, "3rd seg should get next TWO BTs");
                //VerifyFt(3, null, "no trans of verse number");
                VerifyFt(4, trans5 + " " + trans6, "5th seg should get fifth and sixth BTs");
            }
            finally
            {
                Cache.LangProject.TranslatedScriptureOA.UseScriptDigits = false;
                Cache.LangProject.TranslatedScriptureOA.ScriptDigitZero = oldDigitZero;
            }
        }