update
This commit is contained in:
21
src/util.jl
21
src/util.jl
@@ -3,7 +3,8 @@ module util
|
|||||||
export timedifference, showstracktrace, findHighestIndexKey, uuid4snakecase, replaceDictKeys,
|
export timedifference, showstracktrace, findHighestIndexKey, uuid4snakecase, replaceDictKeys,
|
||||||
findMatchingDictKey, textToDict, randstring, randstrings, timeout,
|
findMatchingDictKey, textToDict, randstring, randstrings, timeout,
|
||||||
dataframeToCSV, dfToVectorDict, disintegrate_vectorDict, getDataFrameValue, dfRowtoString,
|
dataframeToCSV, dfToVectorDict, disintegrate_vectorDict, getDataFrameValue, dfRowtoString,
|
||||||
dfToString, dataframe_to_json_list, dict_to_string, extract_triple_backtick_text,
|
dfToString, dataframe_to_json_list, dictToString, dictToString_noKey,
|
||||||
|
dictToString_numbering, extract_triple_backtick_text,
|
||||||
countGivenWords, remove_french_accents, detect_keyword
|
countGivenWords, remove_french_accents, detect_keyword
|
||||||
|
|
||||||
using JSON3, DataStructures, Distributions, Random, Dates, UUIDs, MQTTClient, DataFrames
|
using JSON3, DataStructures, Distributions, Random, Dates, UUIDs, MQTTClient, DataFrames
|
||||||
@@ -709,7 +710,15 @@ end
|
|||||||
|
|
||||||
# Signature
|
# Signature
|
||||||
"""
|
"""
|
||||||
function dict_to_string(od::T) where {T<:AbstractDict}
|
function dictToString(od::T) where {T<:AbstractDict}
|
||||||
|
items = []
|
||||||
|
for (i, (key, value)) in enumerate(od)
|
||||||
|
push!(items, "$key: $value")
|
||||||
|
end
|
||||||
|
return join(items, ", ")
|
||||||
|
end
|
||||||
|
|
||||||
|
function dictToString_numbering(od::T) where {T<:AbstractDict}
|
||||||
items = []
|
items = []
|
||||||
for (i, (key, value)) in enumerate(od)
|
for (i, (key, value)) in enumerate(od)
|
||||||
push!(items, "$i) $key: $value")
|
push!(items, "$i) $key: $value")
|
||||||
@@ -717,6 +726,14 @@ function dict_to_string(od::T) where {T<:AbstractDict}
|
|||||||
return join(items, ", ")
|
return join(items, ", ")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function dictToString_noKey(od::T) where {T<:AbstractDict}
|
||||||
|
items = []
|
||||||
|
for (i, (key, value)) in enumerate(od)
|
||||||
|
push!(items, "$value")
|
||||||
|
end
|
||||||
|
return join(items, ", ")
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
extract_triple_backtick_text(text::String) -> Vector{String}
|
extract_triple_backtick_text(text::String) -> Vector{String}
|
||||||
|
|||||||
Reference in New Issue
Block a user