Skip to content

Commit

Permalink
All tests are passed locally.
Browse files Browse the repository at this point in the history
  • Loading branch information
atantos committed Jan 10, 2024
1 parent 29a2558 commit 0e53fc8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/document.jl
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ OrderedDict{String, Int64} with 7 entries:
"sentence" => 5
⋮ => ⋮
"""
function vocab(input::Union{StringDocument,Vector{String}})
function ordered_vocab(input::Union{StringDocument,Vector{String}})
string_vector = to_string_vector(input) |> unique

# preallocating the ordered dictionary with the size of the string_vector
Expand Down
4 changes: 2 additions & 2 deletions test/document.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ using DataStructures: OrderedDict
@test "a" in keys(ngrams(sd, 1))
@test "string" in keys(ngrams(sd, 1))

@test vocab(sd) == OrderedDict("This" => 1, "is" => 2, "a" => 3, "string" => 4)
@test vocab(["This", "is", "a", "string"]) == OrderedDict("This" => 1, "is" => 2, "a" => 3, "string" => 4)
@test ordered_vocab(sd) == OrderedDict("This" => 1, "is" => 2, "a" => 3, "string" => 4)
@test ordered_vocab(["This", "is", "a", "string"]) == OrderedDict("This" => 1, "is" => 2, "a" => 3, "string" => 4)

@test length(sd) == 16

Expand Down

0 comments on commit 0e53fc8

Please sign in to comment.