#importing the module
using annsp

function test_annsp()
        train_data = {{5.1,3.5,1.4}, {4.9,3.0,1.4}, {4.7,3.2,1.3}, {4.6,3.1,1.5}, {5.0,3.6,1.4}, {5.4,3.9,1.7}, {4.6,3.4,1.4}, {5.0,3.4,1.5}, {4.4,2.9,1.4}, {4.9,3.1,1.5}, {5.4,3.7,1.5}, {4.8,3.4,1.6}, {4.8,3.0,1.4}, {4.3,3.0,1.1}, {5.8,4.0,1.2}, {5.7,4.4,1.5}, {5.4,3.9,1.3}, {5.1,3.5,1.4}, {5.7,3.8,1.7}, {5.1,3.8,1.5}, {5.4,3.4,1.7}, {5.1,3.7,1.5}, {4.6,3.6,1.0}, {5.1,3.3,1.7}, {4.8,3.4,1.9}, {5.0,3.0,1.6}, {5.0,3.4,1.6}, {5.2,3.5,1.5}, {5.2,3.4,1.4}, {4.7,3.2,1.6}, {4.8,3.1,1.6}, {5.4,3.4,1.5}, {5.2,4.1,1.5}, {5.5,4.2,1.4}, {4.9,3.1,1.5}, {5.0,3.2,1.2}, {5.5,3.5,1.3}, {4.9,3.1,1.5}, {4.4,3.0,1.3}, {5.1,3.4,1.5}, {5.0,3.5,1.3}, {4.5,2.3,1.3}, {4.4,3.2,1.3}, {5.0,3.5,1.6}, {5.1,3.8,1.9}, {4.8,3.0,1.4}, {5.1,3.8,1.6}, {4.6,3.2,1.4}, {5.3,3.7,1.5}, {5.0,3.3,1.4}, {7.0,3.2,4.7}, {6.4,3.2,4.5}, {6.9,3.1,4.9}, {5.5,2.3,4.0}, {6.5,2.8,4.6}, {5.7,2.8,4.5}, {6.3,3.3,4.7}, {4.9,2.4,3.3}, {6.6,2.9,4.6}, {5.2,2.7,3.9}, {5.0,2.0,3.5}, {5.9,3.0,4.2}, {6.0,2.2,4.0}, {6.1,2.9,4.7}, {5.6,2.9,3.6}, {6.7,3.1,4.4}, {5.6,3.0,4.5}, {5.8,2.7,4.1}, {6.2,2.2,4.5}, {5.6,2.5,3.9}, {5.9,3.2,4.8}, {6.1,2.8,4.0}, {6.3,2.5,4.9}, {6.1,2.8,4.7}, {6.4,2.9,4.3}, {6.6,3.0,4.4}, {6.8,2.8,4.8}, {6.7,3.0,5.0}, {6.0,2.9,4.5}, {5.7,2.6,3.5}, {5.5,2.4,3.8}, {5.5,2.4,3.7}, {5.8,2.7,3.9}, {6.0,2.7,5.1}, {5.4,3.0,4.5}, {6.0,3.4,4.5}, {6.7,3.1,4.7}, {6.3,2.3,4.4}, {5.6,3.0,4.1}, {5.5,2.5,4.0}, {5.5,2.6,4.4}, {6.1,3.0,4.6}, {5.8,2.6,4.0}, {5.0,2.3,3.3}, {5.6,2.7,4.2}, {5.7,3.0,4.2}, {5.7,2.9,4.2}, {6.2,2.9,4.3}, {5.1,2.5,3.0}, {5.7,2.8,4.1}}
        train_labels = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}
        test_data = {{5.1,3.5,1.4}, {4.9,3.0,1.4}, {4.7,3.2,1.3}, {4.6,3.1,1.5}, {5.0,3.6,1.4}, {5.4,3.9,1.7}, {4.6,3.4,1.4}, {5.7,3.0,4.2}, {5.7,2.9,4.2}, {6.2,2.9,4.3}, {5.1,2.5,3.0}, {5.7,2.8,4.1}}
        test_labels = {1,1,1,1,1,1,1,-1,-1,-1,-1,-1}
        test_n = length(test_labels)
        #new instance of annsp
        k = annsp
        #train
        k.__init__(train_data, train_labels)
        #test
        #using linspace right now, because it seems that the recent push to julia repo has
        #screwed up the range method somehow.
        for i in linspace(1,test_n, test_n)
            print(k.classify(test_data[int(i)]), test_labels[int(i)], '\n')
        end
    end

#call
test_annsp()
