| using Artifacts |
| using DerekoVecs |
| using Test |
| |
| |
| @testset "DerekoVecs.jl" begin |
| |
| wpd19 = load(joinpath(artifact"wpd19_10000", "wpd19_10000", "wpd19_10000.vecs")) |
| |
| @testset "DerekoVecs.jl: loading" begin |
| @test wpd19.m == 200; |
| @test wpd19.n >= 10000; |
| end |
| |
| @testset "DerekoVecs.jl: similarities" begin |
| @test isapprox(DerekoVecs.cos_sim(wpd19, "war", "war"), 1) |
| @test cos_sim(wpd19, "wurden", "war") == cos_sim(wpd19, "war", "wurden") |
| @test cos_sim(wpd19, "wurde", "wurden") > cos_sim(wpd19, "wurde", "ich") |
| @test cos_sim(wpd19, "wurden", "war") == cos_sim(wpd19, wpd19, "war", "wurden") |
| @test isapprox(cos_sim(wpd19, wpd19, "war"), 1) |
| @test isapprox(cos_sim(wpd19, wpd19, 50), 1) |
| @test isapprox(cos_sim(wpd19, 50, 50), 1) |
| end |
| |
| @testset "DerekoVecs.jl: knn" begin |
| @test "dieser" in knn(wpd19, "der", 3) |
| @test "wurden" in knn(wpd19, "wurde", 3) |
| end |
| |
| end |