Esempio n. 1
0
        /// <summary>
        /// Gets the information the user wishes to analyse and prepares it for the network to analyse
        /// </summary>
        /// <param name="file">the file the user wishes to analyse</param>
        public void GetAnalysedText(FileObj file)
        {
            FileReadWrite frw           = new FileReadWrite();
            CategoryObj   analysingText = new CategoryObj(frw.GetStopWords(), frw.GetSuffixes());

            analysingText.Name = file.FileName;
            analysingText.AddText(file.FileContent);
            _analysingText = analysingText;
        }
        /// <summary>
        /// gets the test data for the network to analyse
        /// </summary>
        /// <returns>returns the test data</returns>
        public FileObj[] GetTestData()
        {
            List <FileObj> testData = new List <FileObj>();

            foreach (string file in Directory.EnumerateFiles(_TestDataFolder, "*.txt"))
            {
                FileObj f = new FileObj();
                f.FileName = Path.GetFileName(file).ToLower();
                string content = File.ReadAllText(file);
                f.FileContent = RemovePunctuation(content);
                testData.Add(f);
            }
            return(testData.ToArray());
        }