<commit_before># This file is a part of JuliaFEM.
# License is MIT: see https://github.com/JuliaFEM/JuliaFEM.jl/blob/master/LICENSE.md

module abaqus_reader

using Logging
@Logging.configure(level=DEBUG)

VERSION < v"0.4-" && using Docile

eldims = Dict({"C3D10" => 10})
global handlers = Dict()


@doc """
Register new handler for parser
""" ->
function add_handler(section, function_name)
  handlers[section] = function_name
end

function create_or_get(model, key)
    if !(key in keys(model))
        model[key] = Dict()
    end
    return model[key]
end

function parse_header(header_line)
    args = map(s -> strip(s), split(header_line, ","))
    args[1] = strip(args[1], '*')
    d = Dict({"section" => args[1]})
    options = Dict()
    for k in args[2:end]
        args2 = split(k, "=")
        options[args2[1]] = args2[2]
    end
    d["options"] = options
    return d
end

function parse_node_section(model, header, data)
    nodes = create_or_get(model, "nodes")
    for line in split(data, "\n")
        m = matchall(r"[-0-9.]+", line)
        id = parse(Int, m[1])<commit_msg>Update abaqus_reader.jl<commit_after># This file is a part of JuliaFEM.
# License is MIT: see https://github.com/JuliaFEM/JuliaFEM.jl/blob/master/LICENSE.md

module abaqus_reader

using Logging
@Logging.configure(level=DEBUG)

VERSION < v"0.4-" && using Docile

eldims = Dict({"C3D10" => 10})
global handlers = Dict()


"""
Register new handler for parser
"""
function add_handler(section, function_name)
  handlers[section] = function_name
end

function create_or_get(model, key)
    if !(key in keys(model))
        model[key] = Dict()
    end
    return model[key]
end

function parse_header(header_line)
    args = map(s -> strip(s), split(header_line, ","))
    args[1] = strip(args[1], '*')
    d = Dict({"section" => args[1]})
    options = Dict()
    for k in args[2:end]
        args2 = split(k, "=")
        options[args2[1]] = args2[2]
    end
    d["options"] = options
    return d
end

function parse_node_section(model, header, data)
    nodes = create_or_get(model, "nodes")
    for line in split(data, "\n")
        m = matchall(r"[-0-9.]+", line)
        id = parse(Int, m[1])
{'fraction_non_alphanumeric': 0.1537053979871912, 'fraction_numerical': 0.01738334858188472, 'mean_word_length': 3.4451219512195124, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 10, 'https://': 2, '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': '4292606', 'n_tokens_mistral': 812, 'n_tokens_neox': 794, 'n_words': 195}