correct countGivenWords() docstring
This commit is contained in:
18
src/util.jl
18
src/util.jl
@@ -798,19 +798,19 @@ Count the occurrences of each word in the given list within the provided text.
|
||||
- `words::Vector{String}`: A vector of words whose occurrences need to be counted.
|
||||
|
||||
# Returns
|
||||
- `Dict{String, Int}`: A dictionary where keys are the words from the `words` list and values are their respective counts in the `text`.
|
||||
- `Vector{Int64}`: Their respective counts in the `text`.
|
||||
|
||||
# Examples
|
||||
```julia
|
||||
julia> countGivenWords("hello world hello", ["hello", "world"])
|
||||
Dict{String,Int64} with 2 entries:
|
||||
"hello" => 2
|
||||
"world" => 1
|
||||
julia> GeneralUtils.countGivenWords("hello world hello", ["hello", "world"])
|
||||
2-element Vector{Int64}:
|
||||
2
|
||||
1
|
||||
|
||||
julia> countGivenWords("foo bar baz foo", ["foo", "qux"])
|
||||
Dict{String,Int64} with 2 entries:
|
||||
"foo" => 2
|
||||
"qux" => 0
|
||||
julia> GeneralUtils.countGivenWords("foo bar baz foo", ["foo", "qux"])
|
||||
2-element Vector{Int64}:
|
||||
2
|
||||
0
|
||||
```
|
||||
|
||||
# Signature
|
||||
|
||||
Reference in New Issue
Block a user