Improve sentence splitting logic

This commit is contained in:
Roman Jaroš 2025-03-05 15:00:11 +01:00
parent 8b53a5247c
commit 35e71cfa49
2 changed files with 6 additions and 7 deletions

View file

@ -8,7 +8,7 @@ end
local function SplitSentences(paragraph)
local sentences = {}
for sentence in string.gmatch(paragraph, "([^,%.%?!]+[,%.%?!]?)[%s]*") do
for sentence in string.gmatch(paragraph, "([^%.%?!]+[%.%?!]?)[%s]*") do
local trimmed = sentence:gsub("^%s+", ""):gsub("%s+$", "")
if #trimmed > 0 then
table.insert(sentences, trimmed)

11
sync.sh
View file

@ -2,12 +2,12 @@
src_folder="."
#wow_source_folder="retail"
#wow_destiny_folder="retail"
wow_source_folder="retail"
wow_destiny_folder="retail"
#wow_destiny_folder="beta"
wow_source_folder="classic_era"
wow_destiny_folder="classic_era"
#wow_source_folder="classic_era"
#wow_destiny_folder="classic_era"
# CLASSIC ERA
dest_folder="/Applications/World of Warcraft/_${wow_destiny_folder}_/Interface/AddOns/CzechQuests"
@ -16,5 +16,4 @@ fswatch -o "$src_folder" | while read -r change; do
rsync -avu --delete "$src_folder" "$dest_folder" --exclude={'.*','*.png','*.sh','*.md','Addon/Data/**','downloader/**'}
rsync -au --delete "$src_folder/Addon/Data/$wow_source_folder/" "$dest_folder/Addon/Data/"
cp "$src_folder/Addon/Data/other.lua" "$dest_folder/Addon/Data/"
done
done