Exemplo n.º 1
0
		public override void TestSetup()
		{
			base.TestSetup();
			InterlinLineChoices lineChoices = InterlinLineChoices.DefaultChoices(Cache.LangProject,
																				 Cache.DefaultVernWs,
																				 Cache.DefaultAnalWs,
																				 InterlinLineChoices.InterlinMode.
																					 GlossAddWordsToLexicon);
			m_sandbox = new SandboxForTests(Cache, lineChoices);
		}
Exemplo n.º 2
0
        public override void TestSetup()
        {
            base.TestSetup();
            InterlinLineChoices lineChoices = InterlinLineChoices.DefaultChoices(Cache.LangProject,
                                                                                 Cache.DefaultVernWs,
                                                                                 Cache.DefaultAnalWs,
                                                                                 InterlinLineChoices.InterlinMode.
                                                                                 GlossAddWordsToLexicon);

            m_sandbox = new SandboxForTests(Cache, lineChoices);
        }
Exemplo n.º 3
0
        public override void TestSetup()
        {
            base.TestSetup();
            InterlinLineChoices lineChoices = InterlinLineChoices.DefaultChoices(Cache.LangProject,
                                                                                 Cache.DefaultVernWs,
                                                                                 Cache.DefaultAnalWs,
                                                                                 InterlinLineChoices.InterlinMode.
                                                                                 GlossAddWordsToLexicon);

            m_mediator      = new Mediator();
            m_propertyTable = new PropertyTable(m_mediator);
            m_sandbox       = new SandboxForTests(Cache, m_mediator, m_propertyTable, lineChoices);
        }
Exemplo n.º 4
0
        public override void Exit()
        {
            CheckDisposed();

            // UndoEverything before we clear our wordform table, so we can make sure
            // the real wordform list is what we want to start with the next time.
            base.Exit();

            // clear the wordform table.
            m_text1.Cache.LangProject.WordformInventoryOA.ResetAllWordformOccurrences();
            m_text1 = null;
            // Dispose the sandbox
            m_sandbox.Dispose();
            m_sandbox = null;
        }
Exemplo n.º 5
0
        public override void Initialize()
        {
            CheckDisposed();
            base.Initialize();
            m_text1            = Cache.LangProject.TextsOC.Add(new Text());
            m_text1.ContentsOA = new StText();
            m_text1.ContentsOA.ParagraphsOS.Append(new StTxtPara());
            (m_text1.ContentsOA.ParagraphsOS[0] as StTxtPara).Contents.UnderlyingTsString =
                StringUtils.MakeTss("xxxa xxxb xxxc xxxd xxxe, xxxa xxxb.", Cache.DefaultVernWs);
            bool fDidParse;

            ParagraphParser.ParseText(m_text1.ContentsOA, new NullProgressState(), out fDidParse);
            InterlinLineChoices lineChoices = InterlinLineChoices.DefaultChoices(0, Cache.DefaultAnalWs, Cache.LangProject,
                                                                                 InterlinLineChoices.InterlinMode.GlossAddWordsToLexicon);

            m_sandbox = new SandboxForTests(Cache, lineChoices);
        }
Exemplo n.º 6
0
        /// <summary/>
        internal static void SetupLexEntryAndSense(string formLexEntry, string senseGloss, string partOfSpeech, LcmCache cache,
                                                   SandboxForTests testSandBox, out ILexEntry lexEntry, out ILexSense lexSense)
        {
            ITsString tssLexEntryForm = TsStringUtils.MakeString(formLexEntry, cache.DefaultVernWs);
            // create a sense with a matching gloss
            var entryComponents = MorphServices.BuildEntryComponents(cache, tssLexEntryForm);
            int hvoSenseMsaPos  = testSandBox.GetComboItemHvo(InterlinLineChoices.kflidWordPos, 0, partOfSpeech);

            if (hvoSenseMsaPos != 0)
            {
                entryComponents.MSA.MainPOS = cache.ServiceLocator.GetInstance <IPartOfSpeechRepository>().GetObject(hvoSenseMsaPos);
            }
            entryComponents.GlossAlternatives.Add(TsStringUtils.MakeString(senseGloss, cache.DefaultAnalWs));
            ILexEntry newEntry = cache.ServiceLocator.GetInstance <ILexEntryFactory>().Create(entryComponents);

            lexEntry = newEntry;
            lexSense = newEntry.SensesOS[0];
        }
Exemplo n.º 7
0
 public override void TestTearDown()
 {
     // Dispose managed resources here.
     if (m_sandbox != null)
     {
         m_sandbox.Dispose();
         m_sandbox = null;
     }
     if (m_mediator != null)
     {
         m_mediator.Dispose();
         m_mediator = null;
     }
     if (m_propertyTable != null)
     {
         m_propertyTable.Dispose();
         m_propertyTable = null;
     }
     base.TestTearDown();
 }
Exemplo n.º 8
0
 /// <summary/>
 internal static void SetupLexEntryAndSense(string formLexEntry, string senseGloss, LcmCache cache, SandboxForTests testSandBox, out ILexEntry lexEntry, out ILexSense lexSense)
 {
     SetupLexEntryAndSense(formLexEntry, senseGloss, "adjunct", cache, testSandBox, out lexEntry, out lexSense);
 }
Exemplo n.º 9
0
		public override void Initialize()
		{
			CheckDisposed();
			base.Initialize();
			m_text1 = Cache.LangProject.TextsOC.Add(new Text());
			m_text1.ContentsOA = new StText();
			m_text1.ContentsOA.ParagraphsOS.Append(new StTxtPara());
			(m_text1.ContentsOA.ParagraphsOS[0] as StTxtPara).Contents.UnderlyingTsString =
				StringUtils.MakeTss("xxxa xxxb xxxc xxxd xxxe, xxxa xxxb.", Cache.DefaultVernWs);
			bool fDidParse;
			ParagraphParser.ParseText(m_text1.ContentsOA, new NullProgressState(), out fDidParse);
			InterlinLineChoices lineChoices = InterlinLineChoices.DefaultChoices(0, Cache.DefaultAnalWs, Cache.LangProject,
				InterlinLineChoices.InterlinMode.GlossAddWordsToLexicon);
			m_sandbox = new SandboxForTests(Cache, lineChoices);
		}
Exemplo n.º 10
0
		public override void Exit()
		{
			CheckDisposed();

			// UndoEverything before we clear our wordform table, so we can make sure
			// the real wordform list is what we want to start with the next time.
			base.Exit();

			// clear the wordform table.
			m_text1.Cache.LangProject.WordformInventoryOA.ResetAllWordformOccurrences();
			m_text1 = null;
			// Dispose the sandbox
			m_sandbox.Dispose();
			m_sandbox = null;
		}