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); }
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); }
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; }
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); }
/// <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]; }
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(); }
/// <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); }