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.
|
- `words::Vector{String}`: A vector of words whose occurrences need to be counted.
|
||||||
|
|
||||||
# Returns
|
# 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
|
# Examples
|
||||||
```julia
|
```julia
|
||||||
julia> countGivenWords("hello world hello", ["hello", "world"])
|
julia> GeneralUtils.countGivenWords("hello world hello", ["hello", "world"])
|
||||||
Dict{String,Int64} with 2 entries:
|
2-element Vector{Int64}:
|
||||||
"hello" => 2
|
2
|
||||||
"world" => 1
|
1
|
||||||
|
|
||||||
julia> countGivenWords("foo bar baz foo", ["foo", "qux"])
|
julia> GeneralUtils.countGivenWords("foo bar baz foo", ["foo", "qux"])
|
||||||
Dict{String,Int64} with 2 entries:
|
2-element Vector{Int64}:
|
||||||
"foo" => 2
|
2
|
||||||
"qux" => 0
|
0
|
||||||
```
|
```
|
||||||
|
|
||||||
# Signature
|
# Signature
|
||||||
|
|||||||
Reference in New Issue
Block a user