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:
Lacustat
2026-10-29 22:53:17 +01:00
co-authored by Claude Sonnet 5.5
parent f3ad39df3e
commit f6061b92f2
3 changed files with 35 additions and 2 deletions
+11
View File
@@ -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