Skip to content

Commit db50482

Browse files
authored
Merge pull request #10 from JuliaAI/more-scitype-tests
reconnect and fix scitype tests; rename a test file
2 parents 25510c9 + 864b191 commit db50482

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

test/runtests.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
using Test
22
using MLJText
33

4-
include("tfidf_transformer_tests.jl")
4+
@testset "tfidf_transformer" begin
5+
include("tfidf_transformer.jl")
6+
end
7+
8+
@testset "scitypes" begin
9+
include("scitypes.jl")
10+
end

test/scitypes.jl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import CorpusLoaders
2+
using ScientificTypes
3+
14
@testset "text analysis" begin
25
tagged_word = CorpusLoaders.PosTaggedWord("NN", "wheelbarrow")
36
tagged_word2 = CorpusLoaders.PosTaggedWord("NN", "soil")
@@ -6,13 +9,14 @@
69
@test scitype(bag_of_words) == Multiset{Textual}
710
bag_of_tagged_words = Dict(tagged_word => 5)
811
@test scitype(bag_of_tagged_words) == Multiset{Annotated{Textual}}
9-
@test scitype(Document("My Document", "kadsfkj")) == Unknown
10-
@test scitype(Document([tagged_word, tagged_word2])) ==
12+
@test scitype(CorpusLoaders.Document("My Document", "kadsfkj")) == Unknown
13+
@test scitype(CorpusLoaders.Document([tagged_word, tagged_word2])) ==
1114
Annotated{AbstractVector{Annotated{Textual}}}
12-
@test scitype(Document("My Other Doc", [tagged_word, tagged_word2])) ==
15+
@test scitype(CorpusLoaders.Document("My Other Doc",
16+
[tagged_word, tagged_word2])) ==
1317
Annotated{AbstractVector{Annotated{Textual}}}
1418
nested_tokens = [["dog", "cat"], ["bird", "cat"]]
15-
@test scitype(Document("Essay Number 1", nested_tokens)) ==
19+
@test scitype(CorpusLoaders.Document("Essay Number 1", nested_tokens)) ==
1620
Annotated{AbstractVector{AbstractVector{Textual}}}
1721

1822
@test scitype(Dict(("cat", "in") => 3)) == Multiset{Tuple{Textual,Textual}}
File renamed without changes.

0 commit comments

Comments
 (0)