public static void AddIndexIntoSemanticFragmentTable(string File) { int lengthTable = System.IO.File.ReadAllLines(File).Length + 1; int[,] index = new int[lengthTable, 2]; int ind = 0; using (StreamReader sr = new StreamReader(File)) //System.IO.File.Create(File)) { while (sr.Peek() >= 0) { string s = sr.ReadLine(); string[] s1 = s.Split('\t'); index[ind, 0] = Convert.ToInt32(s1[1]); index[ind, 1] = Convert.ToInt32(s1[2]); ind = ind + 1; } } index = Ivan.SortMatrix(index); index[0, 0] = outdata[0]; index[0, 1] = outdata[1]; index = Ivan.CheckCrossingElements(index); using (StreamWriter sw = new StreamWriter(File)) { for (int i = 0; i < lengthTable; i++) { sw.WriteLine("СФ" + i.ToString() + "\t" + index[i, 0].ToString() + "\t" + index[i, 1].ToString()); } } }
public static void AddIndexIntoSemanticFragmentTable(string File) { int[,] index = ReadInformFromSemanticFragmentTable(File); index = Ivan.SortMatrix(index); index[0, 0] = outdata[0]; index[0, 1] = outdata[1]; index = Ivan.CheckCrossingElements(index); WriteInformIntoSemanticFragmentTable(File, index); }