Пример #1
0
        public void StringServices_HeadwordForWsAndWritingSystem_NumberBeforeKeepsWsForHw()
        {
            var entry1 = MakeEntry("a", "first homograph");
            var hc     = Cache.ServiceLocator.GetInstance <HomographConfiguration>();

            hc.WritingSystem         = "en";
            hc.HomographNumberBefore = true;
            var headwordForWs = StringServices.HeadWordForWsAndHn(entry1, Cache.DefaultVernWs, 1, "???");

            VerifyString(headwordForWs, new[] { "1", "a" }, new[] { Cache.DefaultAnalWs, Cache.DefaultVernWs });
        }
Пример #2
0
        public void StringServices_HeadwordForWsAndWritingSystem_CustomHeadwordNumbers()
        {
            var entry1 = MakeEntry("a", "first homograph");
            var hc     = Cache.ServiceLocator.GetInstance <HomographConfiguration>();

            hc.WritingSystem          = "fr";
            hc.CustomHomographNumbers = new List <string> {
                "O", "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX"
            };
            var headwordForWs = StringServices.HeadWordForWsAndHn(entry1, Cache.DefaultVernWs, 1, "???");

            VerifyString(headwordForWs, new [] { "a", "I" }, new [] { Cache.DefaultVernWs, Cache.DefaultVernWs });
            hc.CustomHomographNumbers = new List <string>();
        }
Пример #3
0
        public void StringServices_HeadwordForWsAndWritingSystem_NoHomographNumbersOnAudioWs()
        {
            var wsEnAudio = Cache.WritingSystemFactory.get_Engine("en-Zxxx-x-audio");

            Cache.LangProject.AddToCurrentVernacularWritingSystems((CoreWritingSystemDefinition)wsEnAudio);
            var entry1 = MakeEntry("a", "first homograph");

            entry1.SetLexemeFormAlt(wsEnAudio.Handle, TsStringUtils.MakeString("en.wav", wsEnAudio.Handle));
            var hc = Cache.ServiceLocator.GetInstance <HomographConfiguration>();

            hc.WritingSystem = "en";
            var headwordForWs = StringServices.HeadWordForWsAndHn(entry1, wsEnAudio.Handle, 1, "???");

            VerifyString(headwordForWs, new[] { "en.wav" }, new[] { wsEnAudio.Handle });
        }
Пример #4
0
        public void StringServices_HeadwordForWsAndWritingSystem_NoAffixMarkerOnAudioWs()
        {
            var wsEnAudio = Cache.WritingSystemFactory.get_Engine("en-Zxxx-x-audio");

            Cache.LangProject.AddToCurrentVernacularWritingSystems((CoreWritingSystemDefinition)wsEnAudio);
            var entry1 = MakeAffixEntry("a", "suffix");

            entry1.SetLexemeFormAlt(wsEnAudio.Handle, TsStringUtils.MakeString("en.wav", wsEnAudio.Handle));
            var hc = Cache.ServiceLocator.GetInstance <HomographConfiguration>();

            hc.WritingSystem         = "en";
            hc.HomographNumberBefore = true;
            var headwordForWs = StringServices.HeadWordForWsAndHn(entry1, wsEnAudio.Handle, 1, "???");

            VerifyString(headwordForWs, new[] { "en.wav" }, new[] { wsEnAudio.Handle });
            // verify the homograph number and affix marker are still on the non-audio headword
            headwordForWs = StringServices.HeadWordForWsAndHn(entry1, Cache.DefaultVernWs, 1, "???");
            VerifyString(headwordForWs, new[] { "1", "-a" }, new[] { Cache.DefaultAnalWs, Cache.DefaultVernWs });
        }