blob: c2834ad9796e5bfc53f3db5654a1b6701a1d3d64 [file] [log] [blame]
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")
end
@testset "DerekoVecs.jl: knn" begin
@test "dieser" in knn(wpd19, "der", 3)
@test "wurden" in knn(wpd19, "wurde", 3)
end
end