Beispiel #1
0
        public static List <Movie> ImportMovieDataFromCsv()
        {
            CsvParserOptions       csvParserOptions = new CsvParserOptions(true, ',');
            CsvMovieDetailsMapping csvMapper        = new CsvMovieDetailsMapping();
            CsvParser <Movie>      csvParser        = new CsvParser <Movie>(csvParserOptions, csvMapper);
            var result = csvParser
                         .ReadFromFile("../ML-TestPredML.ConsoleApp/Resources/movie.csv", Encoding.UTF8)
                         .Select(x => x.Result)
                         .ToList();

            return(result);
        }
Beispiel #2
0
        public static List <Movie> ImportMovieDataFromCsv()
        {
            CsvParserOptions       csvParserOptions = new CsvParserOptions(true, ',');
            CsvMovieDetailsMapping csvMapper        = new CsvMovieDetailsMapping();
            CsvParser <Movie>      csvParser        = new CsvParser <Movie>(csvParserOptions, csvMapper);
            var result = csvParser
                         .ReadFromFile(@"Files\movie.csv", Encoding.UTF8)
                         .Select(x => x.Result)
                         .ToList();

            //Console.WriteLine("MovieId   " + "Title  " + "Genres");
            //foreach (var details in result)
            //{
            //    Console.WriteLine(details.Id + " " + details.Title + " " + details.Genres);
            //}
            return(result);
        }
Beispiel #3
0
        public static List <float> ImportMovieFromTitleSpecified(string title)
        {
            CsvParserOptions       csvParserOptions = new CsvParserOptions(true, ',');
            CsvMovieDetailsMapping csvMapper        = new CsvMovieDetailsMapping();
            CsvParser <Movie>      csvParser        = new CsvParser <Movie>(csvParserOptions, csvMapper);
            List <float>           moviesId         = new List <float>();
            var movies = csvParser
                         .ReadFromFile("../ML-TestPredML.ConsoleApp/Resources/movie.csv", Encoding.UTF8)
                         .Select(x => x.Result)
                         .ToList();

            foreach (var details in movies)
            {
                if (details.Title.Contains(title) || details.Title.Contains(title.ToLower()) || details.Title.Contains(title.ToUpper()))
                {
                    moviesId.Add(details.Id);
                }
            }
            return(moviesId);
        }