コード例 #1
0
        public IEnumerable <SearchElements> Get([FromQuery(Name = "words")] string[] words)
        {
            ActThirteen act13 = new ActThirteen();

            for (int i = 0; i < words.Length; i++)
            {
                string word = words[i];
                words[i] = word.ToLower();
            }
            string fullPath = conf.GetValue <string>(WebHostDefaults.ContentRootKey);
            string myurl    = $"{this.Request.Scheme}://{this.Request.Host}{this.Request.PathBase}/files/";
            var    test     = act13.executeProgram(fullPath, words, true, myurl);
            var    rng      = new Random();

            if (test.Count == 0)
            {
                return(null);
            }
            return(Enumerable.Range(0, test.Count).Select(index => new SearchElements
            {
                filePath = (KeyValuePair <string, int>)test.ToArray().GetValue(index)
            })
                   .ToArray());
        }
コード例 #2
0
        static void Main(string[] args)
        {
            string path = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);

            path += "\\GitHub\\proyecto-ingenieria-software\\seeker";

            /*
             * ActOne act1 = new ActOne();
             * act1.executeProgram(path);
             *
             * ActTwo act2 = new ActTwo();
             * act2.executeProgram(path);
             *
             * ActThree act3 = new ActThree();
             * act3.executeProgram(path);
             *
             * ActFour act4 = new ActFour();
             * act4.executeProgram(path);
             *
             * ActFive act5 = new ActFive();
             * act5.executeProgram(path);
             *
             * ActSix act6 = new ActSix();
             * act6.executeProgram(path);
             *
             * ActSeven act7 = new ActSeven();
             * act7.executeProgram(path);
             *
             * ActEight act8 = new ActEight();
             * act8.executeProgram(path);
             *
             * /*
             * ActNine act9 = new ActNine();
             * act9.executeProgram(path);
             *
             * ActTen act10 = new ActTen();
             * act10.executeProgram(path);
             */

            ActEleven act11 = new ActEleven();

            act11.executeProgram(path);

            ActTwelve act12 = new ActTwelve();

            act12.executeProgram(path, "library", false);

            string[] wordsToFind = new string[] {
                "library", "israel", "views"
            };

            ActThirteen act13 = new ActThirteen();

            act13.executeProgram(path, wordsToFind, false);


            /*
             * EviOne evi1 = new EviOne();
             * int[] cantDocs = {10, 20, 30, 40, 50, 100};
             *
             * foreach(int cant in cantDocs){
             * //TOKENIZACIÓN
             * evi1.executeProgram(path, cant, true, false);
             *
             * //INDEXACIÓN
             * evi1.executeProgram(path, cant, true, true);
             * }
             */
        }