コード例 #1
0
        public async Task GetNumberOfPages()
        {
            int expectedPageCount   = 3;
            int calculatedPageCount = await DataMining.GetDocumentPageCount(pageText);

            Assert.AreEqual(expectedPageCount, calculatedPageCount);
        }
コード例 #2
0
        public async Task <HomeSearchResults> UploadFiles()
        {
            try
            {
                HomeSearchResults   totalResults = new HomeSearchResults();
                IFormFileCollection files        = HttpContext.Request.Form.Files;
                foreach (IFormFile f in files)
                {
                    var stream = f.OpenReadStream();
                    using var sr = new StreamReader(stream);
                    string result = await sr.ReadToEndAsync();

                    HomeSearchResults thisFileResults = await DataMining.MineDataFromText(result);

                    totalResults.HomesForSale.AddRange(thisFileResults.HomesForSale);
                }

                await SaveHomesForSale(totalResults);

                return(new HomeSearchResults(DB.HomesForSale.ToList()));
            }
            catch
            {
                // TODO: Log Exception
                throw;
            }
        }
コード例 #3
0
        private void Treinar()
        {
            string cst      = "Data Source=.\\SQLEXPRESS;AttachDbFilename=\"" + System.IO.Directory.GetCurrentDirectory() + "\\memorias\\test_memory.mdf\";Integrated Security=True;Connect Timeout=30;User Instance=True";
            string document = txt_texto.Text.Trim();

            Formatacao fmtc = new Formatacao();
            Stemming   stmg = new Stemming();
            DataMining dm   = new DataMining();

            List <string> tokensFormatados          = fmtc.Formatacao_completa(document);
            List <string> tokensStemmizados         = stmg.StemmizarListaDeTokens(tokensFormatados);
            List <int>    qtdRepeticaoTokens        = dm.Calcular_frequencia_tokens(tokensStemmizados);
            List <string> tokensRepetidosEliminados = fmtc.Retirar_itens_repetidos(tokensStemmizados);

            treino tr = new treino(cst);

            tr.Memorizar(tokensRepetidosEliminados, qtdRepeticaoTokens, emocao);
        }
コード例 #4
0
ファイル: TeamDetails.cs プロジェクト: MVJ12/Football
        public void ReadDATFile()
        {
            string path = AppDomain.CurrentDomain.BaseDirectory;

            path = path.Substring(0, path.IndexOf("bin"));
            path = path + "DAL";
            string        connString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + path + ";extended Properties=\"text;HDR=YES;FMT=Delimited\"";
            StringBuilder sb         = new StringBuilder();

            using (OleDbConnection conn = new OleDbConnection(connString))
            {
                conn.Open();
                OleDbDataAdapter da         = new OleDbDataAdapter("SELECT Team,P,W,L,D,F,A,Pts from [football.csv]", conn);
                DataSet          dsFootball = new DataSet();
                da.Fill(dsFootball);
                DataTable dtFootball = dsFootball.Tables[0];
                dtFootball = FootballDS.FootballTeams(dtFootball);
                DataMining dm = new DataMining();
                dm.GetTeamsWithMinDiffForAndAgainstGoals(dtFootball);
            }
        }
コード例 #5
0
        public async Task GetPaginationControls()
        {
            IElement paginationControl = await DataMining.GetPaginationControl(pageText);

            Assert.IsNotNull(paginationControl);
        }
コード例 #6
0
 public async Task ParsingSmokeTest()
 {
     HomeSearchResults results = await DataMining.MineDataFromText(pageText);
 }