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. - `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