local type_specifier = ;
local function validate (dab) local dab_no_specifier = ; local count = 0; for i, v in ipairs (type_specifier) do dab_no_specifier, count = dab:gsub (v .. '$', ); if 0 ~= count then break; -- found and removed a specifier end end
if 0
local year = ; local adj = ; if dab_no_specifier:match ('^%d+ %D+') then year, adj = dab_no_specifier:match ('^(%d+) (%D+)'); -- had year and country adjective -- call to validate year -- call to validate country adjective return 'type specifier + adjective + year'; elseif dab_no_specifier:match ('^%d+$') then year = dab_no_specifier:match ('^%d+'); -- had year -- call to validate year return 'type specifier + year ' .. year; elseif dab_no_specifier:match ('^%D+$') then adj = dab_no_specifier; -- had country adjective -- call to validate country adjective return 'type specifier + adjective ' .. adj; elseif
return ;