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 function SplitSentences(paragraph)
local sentences = {} 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+$", "") local trimmed = sentence:gsub("^%s+", ""):gsub("%s+$", "")
if #trimmed > 0 then if #trimmed > 0 then
table.insert(sentences, trimmed) table.insert(sentences, trimmed)

View file

@ -2,12 +2,12 @@
src_folder="." src_folder="."
#wow_source_folder="retail" wow_source_folder="retail"
#wow_destiny_folder="retail" wow_destiny_folder="retail"
#wow_destiny_folder="beta" #wow_destiny_folder="beta"
wow_source_folder="classic_era" #wow_source_folder="classic_era"
wow_destiny_folder="classic_era" #wow_destiny_folder="classic_era"
# CLASSIC ERA # CLASSIC ERA
dest_folder="/Applications/World of Warcraft/_${wow_destiny_folder}_/Interface/AddOns/CzechQuests" dest_folder="/Applications/World of Warcraft/_${wow_destiny_folder}_/Interface/AddOns/CzechQuests"
@ -17,4 +17,3 @@ fswatch -o "$src_folder" | while read -r change; do
rsync -au --delete "$src_folder/Addon/Data/$wow_source_folder/" "$dest_folder/Addon/Data/" 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/" cp "$src_folder/Addon/Data/other.lua" "$dest_folder/Addon/Data/"
done done