Example #1
0
        private static SelectedCoor CorrectionOutdata(SelectedCoor selectedcoor, int[,] Intron)
        {
            int Correction = 0;

            for (int i = 0; i < Intron.Length / 2; i++)
            {
                if (selectedcoor.Start > Intron[i, 0])
                {
                    Correction = Correction + Intron[i, 1] - Intron[i, 0];
                }
            }
            selectedcoor.Start -= Correction;
            selectedcoor.End   -= Correction;
            return(selectedcoor);
        }        //Поправка выделенных координат с учетом координат элементов по типу "СФ" или "___"
Example #2
0
        }        //Проверка выделенного текста на появление в нем элементов по типу "СФ" или "____"

        private static void AddIndexIntoSemanticFragmentTable(string File, SelectedCoor selectedcoor)
        {
            index           = Read_SFT_Add_place_new_element(File);
            index           = SortMatrix(index);
            index[0, 0]     = selectedcoor.Start.ToString();
            index[0, 1]     = selectedcoor.End.ToString();
            index[0, 2]     = NewNameOfSemanticFragment(index);
            ProblemElements = CheckCrossingElements(index);
            if (ProblemElements.Count() > 0)
            {
                MessageBox.Show("Затронуты области пересечения. Попробуйте выделить повторно.");
            }
            else
            {
                index = SortMatrix(index);
                WriteInformIntoSemanticFragmentTable(File, index);
            }
        }        //добавление СФ в таблицу смысловых фрагментов
Example #3
0
        public static bool SelectedTextIntoIndexForSemanticFragmentTable(System.Windows.Forms.TextBox textBox, string File, int[,] Intron)
        {
            var selectedcoor = new SelectedCoor()
            {
                Start = textBox.SelectionStart, End = textBox.SelectionStart + textBox.SelectionLength - 1
            };

            if (selectedcoor.CheckUserSelectText())
            {
                if (!CheckUserSelectedIntrons(selectedcoor.Start, selectedcoor.End, Intron))
                {
                    selectedcoor = CorrectionOutdata(selectedcoor, Intron);
                    AddIndexIntoSemanticFragmentTable(File, selectedcoor);
                    return(true);
                }
            }
            else
            {
                MessageBox.Show("Вы не выделили текст");
            }
            return(false);
        }         //Эта функция вытаскивает выделенный фрагмент и извлекает начальную и конечную координату