예제 #1
0
        static void Main(string[] args)
        {
            stattya s1 = new stattya(@"E:\Універ\Прога\KNN\It1.txt");
            stattya s2 = new stattya(@"E:\Універ\Прога\KNN\It2.txt");
            stattya s3 = new stattya(@"E:\Універ\Прога\KNN\It3.txt");
            vector v1 = new vector("IT");
            v1.add(s1);
            v1.add(s2);
            v1.add(s3);

            stattya ss1 = new stattya(@"E:\Універ\Прога\KNN\Sport1.txt");
            stattya ss2 = new stattya(@"E:\Універ\Прога\KNN\Sport2.txt");
            stattya ss3 = new stattya(@"E:\Універ\Прога\KNN\Sport3.txt");

            vector v2 = new vector("sport");
            v2.add(ss1);
            v2.add(ss2);
            v2.add(ss3);

            analizator a = new analizator(new vector[] { v1, v2 });
            stattya t1 = new stattya(@"E:\Універ\Прога\KNN\It4.txt");
            stattya t2 = new stattya(@"E:\Універ\Прога\KNN\Sport4.txt");

            Console.WriteLine(a.audit(t1));
            Console.WriteLine(a.audit(t2));
            Console.ReadKey();
        }
예제 #2
0
 public analizator(vector[] vectors_)
 {
     vectors = vectors_;
 }
예제 #3
0
 public analyser(vector[] vectors_)
 {
     vectors = vectors_;
 }
예제 #4
0
        static void Main(string[] args)
        {
            kNN p1 = new kNN(@"articles\science-1.txt");
            kNN p2 = new kNN(@"articles\science-2.txt");
            kNN p3 = new kNN(@"articles\science-3.txt");

            vector v1 = new vector("science");
            v1.add(p1);
            v1.add(p2);
            v1.add(p3);

            kNN p21 = new kNN(@"articles\sport-1.txt");
            kNN p22 = new kNN(@"articles\sport-2.txt");
            kNN p23 = new kNN(@"articles\sport-3.txt");

            vector v2 = new vector("sport");
            v2.add(p21);
            v2.add(p22);
            v2.add(p23);

            analyser a = new analyser(new vector[] { v1, v2 });
            kNN t1 = new kNN(@"articles\unknown-science.txt");
            kNN t2 = new kNN(@"articles\unknown-sport.txt");

            Console.WriteLine(a.check(t1));
            Console.WriteLine(a.check(t2));
        }
예제 #5
0
        static void Main(string[] args)
        {
            list list1 = new list(@"D:\FIT\Програмування\2\prog\kNN\posts\d11.txt");
            list list2 = new list(@"D:\FIT\Програмування\2\prog\kNN\posts\d21.txt");
            list list3 = new list(@"D:\FIT\Програмування\2\prog\kNN\posts\d31.txt");
            vector v1 = new vector("animalworld");
            v1.add(list1);
            v1.add(list2);
            v1.add(list3);

            list list1b = new list(@"D:\FIT\Програмування\2\prog\kNN\posts\d12.txt");
            list list2a = new list(@"D:\FIT\Програмування\2\prog\kNN\posts\d22.txt");
            list list3a = new list(@"D:\FIT\Програмування\2\prog\kNN\posts\d32.txt");

            vector v2 = new vector("football");
            v2.add(list1b);
            v2.add(list2a);
            v2.add(list3a);

            list d1 = new list(@"D:\FIT\Програмування\2\prog\kNN\posts\d1.txt");
            list d2 = new list(@"D:\FIT\Програмування\2\prog\kNN\posts\d2.txt");

            analyzer analyzer = new analyzer(new vector[] { v1, v2 });
            Console.WriteLine(analyzer.account(d1));
            Console.WriteLine(analyzer.account(d2));

            Console.ReadLine();
        }
예제 #6
0
        static void Main(string[] args)
        {
            post p1 = new post(@"posts\1t1.txt");
            post p2 = new post(@"posts\2t1.txt");
            post p3 = new post(@"posts\3t1.txt");
            vector v1 = new vector("наука");
            v1.add(p1);
            v1.add(p2);
            v1.add(p3);

            post p21 = new post(@"posts\1t2.txt");
            post p22 = new post(@"posts\2t2.txt");
            post p23 = new post(@"posts\3t2.txt");

            vector v2 = new vector("sport");
            v2.add(p21);
            v2.add(p22);
            v2.add(p23);

            analizator a = new analizator(new vector[] { v1, v2 });
            post t1 = new post(@"posts\t1.txt");
            post t2 = new post(@"posts\t2.txt");

            Console.WriteLine(a.audit(t1));
            Console.WriteLine(a.audit(t2));
        }