/// <summary> /// Artefact -> XML /// </summary> /// <param name="fileName"></param> /// <param name="xmlFileName"></param> public void CreateXMLFromRawArtefactsText(string fileName, string xmlFileName) { var devicesAsDictionariesList = ParseFileToDeviceDictionaries(fileName); List <Artefact> artefactsList = GetArtefactsListFromDictionaries(devicesAsDictionariesList); NumeneraXML.SerializeToXml(artefactsList, xmlFileName); }
/// <summary> /// Cyphers -> XML /// </summary> /// <param name="fileName">file with raw text from PDF</param> /// <param name="xmlFileName">created xml file</param> public void CreateXMLFromRawCyphersText(string fileName, string xmlFileName) { var devicesAsDictionariesList = ParseFileToDeviceDictionaries(fileName); List <Cypher> cyphersList = GetCyphersListFromDictionaries(devicesAsDictionariesList); NumeneraXML.SerializeToXml(cyphersList, xmlFileName); }
public void CreateXMLFromRawOddities(string fileName, string xmlFileName) { var lines = File.ReadAllLines(fileName); for (int i = 0; i < lines.Length; i++) { if (lines[i] == "") { continue; } var currentLine = lines[i]; int j = 0; if (char.IsDigit(currentLine[0])) { for (; j < currentLine.Length; j++) { if (!char.IsDigit(currentLine[j]) && !char.IsWhiteSpace(currentLine[j]) && currentLine[j] != '.') { break; } } } lines [i] = currentLine.Substring(j); } var oddities = new List <Oddity>(); foreach (var line in lines) { oddities.Add(new Oddity() { Description = line, Source = Source }); } oddities.ForEach(x => Console.WriteLine(x.Description)); NumeneraXML.SerializeToXml(oddities, xmlFileName); }