blob: c2834ad9796e5bfc53f3db5654a1b6701a1d3d64 [file] [log] [blame]
Marc Kupietz41b0f682022-07-21 15:32:45 +02001using Artifacts
Marc Kupietz7101f9e2022-07-21 08:58:19 +02002using DerekoVecs
3using Test
4
Marc Kupietz41b0f682022-07-21 15:32:45 +02005
Marc Kupietz7101f9e2022-07-21 08:58:19 +02006@testset "DerekoVecs.jl" begin
Marc Kupietz41b0f682022-07-21 15:32:45 +02007
8 wpd19 = load(joinpath(artifact"wpd19_10000", "wpd19_10000", "wpd19_10000.vecs"))
9
10 @testset "DerekoVecs.jl: loading" begin
11 @test wpd19.m == 200;
12 @test wpd19.n >= 10000;
13 end
14
15 @testset "DerekoVecs.jl: similarities" begin
16 @test isapprox(DerekoVecs.cos_sim(wpd19, "war", "war"), 1)
17 @test cos_sim(wpd19, "wurden", "war") == cos_sim(wpd19, "war", "wurden")
18 @test cos_sim(wpd19, "wurde", "wurden") > cos_sim(wpd19, "wurde", "ich")
19 @test cos_sim(wpd19, "wurden", "war") == cos_sim(wpd19, wpd19, "war", "wurden")
20 end
21
22 @testset "DerekoVecs.jl: knn" begin
23 @test "dieser" in knn(wpd19, "der", 3)
24 @test "wurden" in knn(wpd19, "wurde", 3)
25 end
26
Marc Kupietz7101f9e2022-07-21 08:58:19 +020027end