Marc Kupietz | 41b0f68 | 2022-07-21 15:32:45 +0200 | [diff] [blame] | 1 | using Artifacts |
Marc Kupietz | 7101f9e | 2022-07-21 08:58:19 +0200 | [diff] [blame] | 2 | using DerekoVecs |
| 3 | using Test |
| 4 | |
Marc Kupietz | 41b0f68 | 2022-07-21 15:32:45 +0200 | [diff] [blame] | 5 | |
Marc Kupietz | 7101f9e | 2022-07-21 08:58:19 +0200 | [diff] [blame] | 6 | @testset "DerekoVecs.jl" begin |
Marc Kupietz | 41b0f68 | 2022-07-21 15:32:45 +0200 | [diff] [blame] | 7 | |
| 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 Kupietz | 7101f9e | 2022-07-21 08:58:19 +0200 | [diff] [blame] | 27 | end |