From 5529f742bccc67fb539620f804a6b5f508ea14f4 Mon Sep 17 00:00:00 2001 From: Kevin Lyles Date: Sun, 24 Feb 2013 11:14:07 -0600 Subject: [PATCH] Consolidated several patterns (and caught some more items in the process) --- Locales/enUS/patterns-enchants.lua | 5 +--- Locales/enUS/patterns-fishing.lua | 3 +- Locales/enUS/patterns-food.lua | 3 +- Locales/enUS/patterns-use-effects.lua | 5 +--- Locales/enUS/patterns.lua | 49 +++------------------------------ 5 files changed, 8 insertions(+), 57 deletions(-) diff --git a/Locales/enUS/patterns-enchants.lua b/Locales/enUS/patterns-enchants.lua index c4c7244..5d4bf9b 100644 --- a/Locales/enUS/patterns-enchants.lua +++ b/Locales/enUS/patterns-enchants.lua @@ -52,10 +52,7 @@ local EnchantPreprocessLines = { {" reduce threat slightly ", " 2%% reduced threat "}, {" a minor movement speed ", " minor run speed "}, {" movement speed by 8%%", " minor run speed increase"}, - {" reducing the duration of disarm effects by ", " disarm duration reduced by "}, - -- item 95349 - {" reduces the duration of disarm effects by ", " disarm duration reduced by "}, - -- items 28270 and 37340 + {" reduce?s?i?n?g? the duration of disarm effects by ", " disarm duration reduced by "}, {" resilience ", " pvp resilience "}, {" pvp pvp resilience ", " pvp resilience "}, -- item 22023 diff --git a/Locales/enUS/patterns-fishing.lua b/Locales/enUS/patterns-fishing.lua index dfd9c85..322dc36 100644 --- a/Locales/enUS/patterns-fishing.lua +++ b/Locales/enUS/patterns-fishing.lua @@ -24,8 +24,7 @@ local FishingAffixes = { "^attach a lure to your equipped fishing pole, increasing +", "%.$", "utes$", - " +[35] min", - " +1[05] min$", + " +%d+ min$", " +1 hour$", " +for$", } diff --git a/Locales/enUS/patterns-food.lua b/Locales/enUS/patterns-food.lua index a6fda36..4a3aa1e 100644 --- a/Locales/enUS/patterns-food.lua +++ b/Locales/enUS/patterns-food.lua @@ -56,8 +56,7 @@ local FoodAffixes = { " +green means it's good!$", " +and gets you pretty drunk%.$", " +and gets you drunk to boot[%.!]$", - " +standard alcohol%.$", - " +strong alcohol%.$", + " +st%a+ alcohol%.$", " +also packs quite a kick%.%.%.$", " +smooo+th%.$", " +and increases the drinker's desire to converse%.$", diff --git a/Locales/enUS/patterns-use-effects.lua b/Locales/enUS/patterns-use-effects.lua index 7a1f535..e1b5117 100644 --- a/Locales/enUS/patterns-use-effects.lua +++ b/Locales/enUS/patterns-use-effects.lua @@ -9,14 +9,11 @@ local UseEffectMatchLines = { local UseEffectIgnoreLines = { "^use: heal", - "^use: a strong alcoholic beverage", + "^use: a %a* ?%a* ?alcohol", "^use: transform", "^use: a sample of ", - "^use: a typical alcoholic beverage", " if they have free room ", - "^use: a weak alcohol", "^use: throw into ", - "^use: a strangely glowing alcoholic beverage", "^use: instantly restores ", "^use: reduces ", "^use: combines? ", diff --git a/Locales/enUS/patterns.lua b/Locales/enUS/patterns.lua index 4f6e419..4cbfeb9 100644 --- a/Locales/enUS/patterns.lua +++ b/Locales/enUS/patterns.lua @@ -27,21 +27,12 @@ function WeightsWatcher.damageRange(textL, textR) stats["average melee weapon damage"] = (minimum + maximum) / 2 stats["maximum melee weapon damage"] = maximum else - local start, _, damage = string.find(textL, "^(%d+) damage$") + local start, _, damage = string.find(textL, "^(%d+) %a* ?damage$") if start then stats = WeightsWatcher.newStatTable() damage = tonumber(damage) stats["average melee weapon damage"] = damage stats["maximum melee weapon damage"] = damage - else - -- item 7730 - local start, _, damage = string.find(textL, "^%+(%d+) frost damage$") - if start then - stats = WeightsWatcher.newStatTable() - damage = tonumber(damage) - stats["average melee weapon damage"] = damage - stats["maximum melee weapon damage"] = damage - end end end if stats and textR then @@ -181,26 +172,8 @@ ww_TempIgnoredLines = { "^%d+ slot ", "^use: heals %d+ damage over %d+ sec%.$", -- Profession patterns - "^use: teaches you how to make ", - "^use: teaches you how to cut ", - "^use: teaches you how to craft ", - "^use: teaches you how to sew ", - "^use: teaches you how to cook ", - "^use: teaches you how to forge ", - "^use: teaches you how to transmute ", - "^use: teaches you how to create ", - "^use: teaches you how to bake ", - "^use: teaches you how to be ", - "^use: teaches you how to summon ", - "^use: teaches you how to brew ", - "^use: teaches you how to inscribe ", - "^use: teaches you how to ride ", - "^use: teaches you how to burn ", - "^use: teaches you how to deep fry ", - "^use: teaches you how to purify ", - "^use: teaches you how to shatter ", - "^use: teaches you how to smelt ", - "^use: teaches you how to turn ", + "^use: teaches you how to [a-oq-z]%a+ ", + "^use: teaches you how to p[a-df-z]%a+ ", } ww_UnweightedLines = { @@ -506,21 +479,7 @@ ww_SingleStatLines = { }, -- Tends to eat other stats if not last - {"^(%a+ ?%a+ ?%a+ ?%a+) by ([+-]?%d+%%?)$", - function(text, pattern, section) - local start, _, name, value = string.find(text, pattern) - if start then - local stats = WeightsWatcher.parseStats(value .. " " .. name, section) - if stats then - return stats.stats - end - end - end, - {"cooldownUseEffect", "elixir", "enchant", "equipEffect", "food", "stackingEquipEffect", "useEffect"}, - }, - - -- Tends to eat other stats if not last - {"^(%a+ ?%a+ ?%a+) by ([+-]?%d+%%?)$", + {"^(%a+ ?%a+ ?%a* ?%a+) by ([+-]?%d+%%?)$", function(text, pattern, section) local start, _, name, value = string.find(text, pattern) if start then -- 1.7.9.5