correct countGivenWords() docstring

This commit is contained in:
narawat lamaiin
2025-01-06 06:19:28 +07:00
parent 44a27a0ba4
commit d8e1cbb94a

View File

@@ -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