Exemplo n.º 1
0
        public static string ProtectFromCrazyMan(string text, Neo4j neo4J)
        {
            text = KillStrangeElements(text);
            text = text[0].ToString().ToUpper() + text.Substring(1);
            var allterms = neo4J.FindAllTerms();
            var repeats  = allterms.FindAll(x => x.name == text);

            if (repeats.Count == 0)
            {
                return(text);
            }
            else
            {
                MessageBox.Show("Такое понятие уже существует");
            }
            return("");
        }
Exemplo n.º 2
0
        public static void SelecteTextSecondWindow(TextBox textBox, Neo4j neo4j, int[,] Intron)
        {
            int[] outdata = new int[2];
            outdata[0] = textBox.SelectionStart;
            outdata[1] = textBox.SelectionStart + textBox.SelectionLength - 1;
            string text = textBox.SelectedText;

            if (!CreateSemanticFile.CheckUserSelectedIntrons(outdata[0], outdata[1], Intron))
            {
                neo4j.ConnectToDataBase("http://localhost:7474/db/data", "neo4j", "1234");
                text = ProtectFromCrazyMan(text, neo4j);
                if (text != "")
                {
                    neo4j.AddTerm(text);
                }
            }
        }