Exemple #1
0
        public void StartCreateHyper(object showRun)
        {
            try
            {
                ShowHyperRun curRun = (ShowHyperRun)showRun;
                if (curRun.CurDeep > curRun.DeepSearch || Interlocked.Read(ref StopCreateHyper) == 0)
                {
                    return;
                }

                //WordSemanticBranch newBranch = m_SemanticHelper.GetSemanticLinkFromDB(curRun.CurDeep == 1 ? "тест2" : curRun.WordLink.ParentWord.Word);
                WordSemanticBranch newBranch = m_SemanticHelper.GetSemanticLinkFromDB(curRun.WordLink.ParentWord.Word);
                curRun.WordLink = newBranch;
                OnHyperChainAdded(new HyperChainAddedEventArgs(curRun));
                int  nNewDeepSearch = curRun.DeepSearch - 1;
                bool bNewBranch     = false;
                foreach (WordLink link in newBranch.Children)
                {
                    WordSemanticBranch childBranch = m_SemanticHelper.GetSemanticLinkFromDB(link.Child.Word);
                    if (childBranch != null &&
                        (link.RelationType == WordLinkType.eNormal ||
                         link.RelationType == WordLinkType.eTentative))
                    {
                        StartCreateHyper(new ShowHyperRun(childBranch, curRun.DeepSearch, curRun.CurDeep + 1, bNewBranch));
                    }
                    bNewBranch = true;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(string.Format("{0}\n{1}", "CLientLogic.StartSearch", ex.Message));
            }
        }
Exemple #2
0
        public void GetSemanticLinkFromDBTest()
        {
            SemanticHelper     target   = new SemanticHelper(); // TODO: Initialize to an appropriate value
            string             sWord    = string.Empty;         // TODO: Initialize to an appropriate value
            WordSemanticBranch expected = null;                 // TODO: Initialize to an appropriate value
            WordSemanticBranch actual;

            actual = target.GetSemanticLinkFromDB(sWord);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }