From 44a27a0ba458389701266165b0bac1991e0a85a0 Mon Sep 17 00:00:00 2001 From: narawat lamaiin Date: Mon, 6 Jan 2025 06:11:24 +0700 Subject: [PATCH 1/6] change version --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 743c246..6f67f6c 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "GeneralUtils" uuid = "c6c72f09-b708-4ac8-ac7c-2084d70108fe" authors = ["tonaerospace "] -version = "0.1.0" +version = "0.1.1-dev" [deps] CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b" From d8e1cbb94ade7ef46d861fadc0126ab7b3456b0a Mon Sep 17 00:00:00 2001 From: narawat lamaiin Date: Mon, 6 Jan 2025 06:19:28 +0700 Subject: [PATCH 2/6] correct countGivenWords() docstring --- src/util.jl | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/util.jl b/src/util.jl index fd66f32..624f873 100644 --- a/src/util.jl +++ b/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 From 6d7094028fb63a4dc12016aaa09d411276763528 Mon Sep 17 00:00:00 2001 From: narawat lamaiin Date: Mon, 6 Jan 2025 13:12:11 +0700 Subject: [PATCH 3/6] update --- src/util.jl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/util.jl b/src/util.jl index 624f873..ab4b4b7 100644 --- a/src/util.jl +++ b/src/util.jl @@ -284,7 +284,10 @@ function textToDict(text::String, keywords::Vector{String}; kw = [] # use for loop and detect_keyword function to get the exact variation of each keyword in the text then push to kw list for keyword in keywords - push!(kw, detect_keyword(keyword, text)) + detected = detect_keyword(keyword, text) + if detected !== nothing + push!(kw, detected) + end end od1, od2 = From 95b3997f5230cc3f9585a84a282f718abf023015 Mon Sep 17 00:00:00 2001 From: narawat lamaiin Date: Sat, 11 Jan 2025 16:57:32 +0700 Subject: [PATCH 4/6] update --- src/util.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util.jl b/src/util.jl index ab4b4b7..bc82e30 100644 --- a/src/util.jl +++ b/src/util.jl @@ -4,7 +4,7 @@ export timedifference, showstracktrace, findHighestIndexKey, uuid4snakecase, rep findMatchingDictKey, textToDict, randstring, randstrings, timeout, dataframeToCSV, dfToVectorDict, disintegrate_vectorDict, getDataFrameValue, dfRowtoString, dfToString, dataframe_to_json_list, dict_to_string, extract_triple_backtick_text, - countGivenWords, remove_french_accents + countGivenWords, remove_french_accents, detect_keyword using JSON3, DataStructures, Distributions, Random, Dates, UUIDs, MQTTClient, DataFrames From b0d80930c9905e6fe8782b54377097ad07c41166 Mon Sep 17 00:00:00 2001 From: narawat lamaiin Date: Tue, 14 Jan 2025 07:52:22 +0700 Subject: [PATCH 5/6] update --- src/communication.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/communication.jl b/src/communication.jl index 5a9b5cf..e780f46 100644 --- a/src/communication.jl +++ b/src/communication.jl @@ -117,7 +117,7 @@ end julia> using Revise julia> using GeneralUtils, Dates, JSON3, UUIDs julia> mqttMsgReceiveTopic = ["/receivetopic_1", "/receivetopic_2"] - julia> mqttMsgReceiveChannel = (ch1=Channel(8), ch2=Channel(32)) + julia> mqttMsgReceiveChannel = (ch1=Channel(8), ch2=Channel(32)) # single channel Ex. (ch1=Channel(8),) julia> keepaliveChannel = Channel(8) julia> function onMsgCallback(topic, payload) jobj = JSON3.read(String(payload)) From 496a6520c8559e3bcfc7c98070e7ffb09c7602d4 Mon Sep 17 00:00:00 2001 From: narawat lamaiin Date: Tue, 14 Jan 2025 07:57:15 +0700 Subject: [PATCH 6/6] merge v0.1.1 --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 6f67f6c..47e8db1 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "GeneralUtils" uuid = "c6c72f09-b708-4ac8-ac7c-2084d70108fe" authors = ["tonaerospace "] -version = "0.1.1-dev" +version = "0.1.1" [deps] CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"