예제 #1
0
        /// <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);
        }
예제 #2
0
        /// <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);
        }
예제 #3
0
        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);
        }