local _, addon = ... local function BuildIndex(text) local numberMarks = text:gsub("%d+%.?%d*", "#?") local normalized = numberMarks:gsub('"', "'") return normalized end local function FillPlaceholders(text) if text == nil then return text end local playerName = UnitName("player") local formatted = text; formatted = string.gsub(formatted, '', playerName); return formatted end local function GetSpeech(message) local index = BuildIndex(message) local speech = addon.data.speech[index]; local text = speech and speech.m or nil if text then return FillPlaceholders( addon.API.FillNumbers(text, message) ) else return nil end end addon.API.GetSpeech = GetSpeech