<commit_before>--
--  xmlparser.lua
--  publisher
--
--  Copyright 2011 <NAME>.
--  See file COPYING in the root directory for license details.

local xmlreader = xmlreader
local w = w
local setmetatable,tostring = setmetatable,tostring
local table,string = table,string

module(...)

-- the root node for additional namespace information (the function prefix)
local root = nil

-- Return the textvalue of an element (tostring(xml))
local function xml_to_string( self )
  local ret = {}
  for i=1,#self do
    ret[#ret + 1] = tostring(self[i])
  end
  return table.concat(ret)
end

local mt = {
  __tostring = xml_to_string
}

function read_element(r)
  local ret = {}
  -- we set the global root element if unset to store ns info
  root = root or ret<commit_msg>Can't emit 'error' on error.<commit_after>--
--  xmlparser.lua
--  publisher
--
--  Copyright 2011 <NAME>.
--  See file COPYING in the root directory for license details.

local xmlreader = xmlreader
local w = w
local setmetatable,tostring,print = setmetatable,tostring,print
local table,string = table,string

module(...)

-- the root node for additional namespace information (the function prefix)
local root = nil

-- Return the textvalue of an element (tostring(xml))
local function xml_to_string( self )
  local ret = {}
  for i=1,#self do
    ret[#ret + 1] = tostring(self[i])
  end
  return table.concat(ret)
end

local mt = {
  __tostring = xml_to_string
}

function read_element(r)
  local ret = {}
  -- we set the global root element if unset to store ns info
  root = root or ret
{'fraction_non_alphanumeric': 0.10173857050869285, 'fraction_numerical': 0.0077269800386349004, 'mean_word_length': 3.543859649122807, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 12}, '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': '6921327', 'n_tokens_mistral': 505, 'n_tokens_neox': 495, 'n_words': 181}