mirror of
https://github.com/Lacustat/Freewood-OctoWoW-Codex.git
synced 2026-11-06 07:28:57 +00:00
0.1.186: Rechenspitzen im Hintergrund (Lernplan, Ziele, Datenzählung, Berufs-Hinweis)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016onJCSHLwhs9udhC9ZLzk9
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
f3ad39df3e
commit
f6061b92f2
@@ -997,8 +997,19 @@ Codex.CLASS_TOKENS = {}
|
||||
for token in pairs(CLASS_WORDS) do Codex.CLASS_TOKENS[token] = true end
|
||||
|
||||
-- Klasse eines Lehrers aus der Titelzeile ("Hexenmeisterlehrer" -> WARLOCK)
|
||||
-- Ergebnis je Titel merken: der Lernplan fragt fuer jeden Lehrer mehrfach, und die Wortsuche ueber alle Klassennamen
|
||||
-- war der groesste Teil der Rechenzeit (Dev-Log: ca. 540 ms fuer den Lernplan).
|
||||
local titleClass = {}
|
||||
function Codex.ClassOfTitle(title)
|
||||
if type(title) ~= "string" or title == "" then return nil end
|
||||
local c = titleClass[title]
|
||||
if c ~= nil then return c or nil end
|
||||
c = Codex.ClassOfTitleCompute(title)
|
||||
titleClass[title] = c or false
|
||||
return c
|
||||
end
|
||||
|
||||
function Codex.ClassOfTitleCompute(title)
|
||||
local low = title:lower()
|
||||
local best, bestLen
|
||||
for token, words in pairs(CLASS_WORDS) do
|
||||
|
||||
Reference in New Issue
Block a user