<commit_before>local Text = {}
Text.__index = Text

local tableContains = function(t, value)
    for k, v in pairs(t) do
        if v == value then return true end
    end
end

function Text.new(text, settings)
	if ( text:find( "%[" ) or text:find( "%(" ) ) or ( text:find( "%]" ) or text:find( "%)" ) ) then
        if text:find( "%f[^%[](.-)%f[%]]" ) and not text:find( "%f[^%(](.-)%f[%)]" ) then
            error( "No function defined, either drop the []s or define a function and apply it to the text using ()" ) 
        end
        error( "Syntax error: make sure you close \"[]\"." )
    end
	
    local self = {}

    local settings = settings or {}
    for k, v in pairs(settings) do self[k] = v end

    self.text = text
    if not self.font then self.font = love.graphics.getFont() end

    -- Store modifier names and parameters in m
    local m = {}
    local i = 1
    while i <= text:len() do
        local c = text:sub(i, i)
        local d = text:sub(i+1, i+1)

        if c == '@' and (d == '[' or d == ']' or d == '(' or d == ')' or d == '@' or d == 'n') then i = i + 1 end

        if c == '[' then
            local modifier = {}
            modifier.init_text_delimiter = i
            -- Look for pairing ']'
            local delimiter_ignore = 0<commit_msg>Remove extra Text check as it was making default behavior fail<commit_after>local Text = {}
Text.__index = Text

local tableContains = function(t, value)
    for k, v in pairs(t) do
        if v == value then return true end
    end
end

function Text.new(text, settings)
    local self = {}

    local settings = settings or {}
    for k, v in pairs(settings) do self[k] = v end

    self.text = text
    if not self.font then self.font = love.graphics.getFont() end

    -- Store modifier names and parameters in m
    local m = {}
    local i = 1
    while i <= text:len() do
        local c = text:sub(i, i)
        local d = text:sub(i+1, i+1)

        if c == '@' and (d == '[' or d == ']' or d == '(' or d == ')' or d == '@' or d == 'n') then i = i + 1 end

        if c == '[' then
            local modifier = {}
            modifier.init_text_delimiter = i
            -- Look for pairing ']'
            local delimiter_ignore = 0
{'fraction_non_alphanumeric': 0.14883093525179855, 'fraction_numerical': 0.0044964028776978415, 'mean_word_length': 2.0774550484094054, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5880587', 'n_tokens_mistral': 737, 'n_tokens_neox': 703, 'n_words': 268}