public void check() { var mf = new Classifier.Nodes.NodesCollection(); var dict = new Dictionary <(int, int), int>(); var list = ""; var type = 0; var kind = 0; foreach (var row in Plots.Rows) { if (row.RowID % 10000 == 0) { Console.WriteLine(row.RowID); } try { list = row["VRI_List"]; type = row["fs_tip"]; kind = row["fs_vid"]; } catch { continue; } var error = CodesMutator.CheckCodes.CheckTypesIsConfirmityCodes(list, type, kind, ref dict, mf); list = ""; type = 0; kind = 0; row["Error"] = error; } }
public void Mutate() { var mf = new Classifier.Nodes.NodesCollection(); var list = ""; var type = 0; foreach (var row in Plots.Rows) { Console.WriteLine(row.RowID); try { list = row["VRI_List"]; type = row["fs_tip"]; } catch { continue; } var newList = CodesMutator.Mutator.Execute(list, type, mf); row["Vri_PZZ"] = newList; } }
static void Main() { var mf = new Classifier.Nodes.NodesCollection(); var app = new MapInfoAppControls(new MapinfoCurrentApp()); app.TablesShow(); Context context = null; try { context = new Context(); } catch (Exception e) { Console.WriteLine(e); } finally { context.Dispose(); } var table = app.GetTable(); Console.WriteLine("Number of rows is: {0}", table.Lenght); var sw = new Stopwatch(); sw.Start(); foreach (var val in table.Rows) { Console.WriteLine("{0} rows was comleted", val.RowID); try { string vri_egrn = string.IsNullOrEmpty(val["Наименование_ОКС"]) ? val["Назначение"] : val["Наименование_ОКС"]; string vri_dgi = val["ДГИ_назначение"]; if (!string.IsNullOrEmpty(vri_egrn)) { Classifier.InputData data = new Classifier.InputData(vri_egrn, 600); Classifier.Factory factory = new Classifier.Factory(data); factory.Execute(); var vri = factory.outputData.VRI_List; val["VRI_EGRN"] = vri; } if (!string.IsNullOrEmpty(vri_dgi)) { Classifier.InputData data = new Classifier.InputData(vri_dgi, 600); Classifier.Factory factory = new Classifier.Factory(data); factory.Execute(); var vri = factory.outputData.VRI_List; val["VRI_DGI"] = vri; } } catch (Exception e) { Console.WriteLine(e.Message); continue; } } sw.Stop(); }