<commit_before>import Foundation
import libxml2


class HTMLParser {
    
    enum Error: String, Swift.Error {
        case NoRootNode = "No root node"
    }

    /// Parses HTML data into an HTML Node representing the same data.
    ///
    /// - Parameters:
    ///     - html: the HTML string to parse.
    ///
    /// - Returns: the HTML root node.
    ///
    func parse(_ html: String) -> RootNode {

        // We wrap the HTML into a special root node, since it helps avoid conversion issues
        // with libxml2, where the library would add custom tags to "fix" the HTML code we
        // provide.
        //
        let wrappedHTML = "<\(RootNode.name)>\(html)</\(RootNode.name)>"
        let data = wrappedHTML.data(using: String.Encoding.utf8)!

        let bufferSize = 1024<commit_msg>HTMLParser: Opening up!<commit_after>import Foundation
import libxml2


open class HTMLParser {
    
    enum Error: String, Swift.Error {
        case NoRootNode = "No root node"
    }

    /// Public initializer
    ///
    public init() { }


    /// Parses HTML data into an HTML Node representing the same data.
    ///
    /// - Parameters:
    ///     - html: the HTML string to parse.
    ///
    /// - Returns: the HTML root node.
    ///
    open func parse(_ html: String) -> RootNode {

        // We wrap the HTML into a special root node, since it helps avoid conversion issues
        // with libxml2, where the library would add custom tags to "fix" the HTML code we
        // provide.
        //
        let wrappedHTML = "<\(RootNode.name)>\(html)</\(RootNode.name)>"
        let data = wrappedHTML.data(using: String.Encoding.utf8)!

        let bufferSize = 1024
{'fraction_non_alphanumeric': 0.11262596324836989, 'fraction_numerical': 0.008298755186721992, 'mean_word_length': 1.9356521739130435, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '525007', 'n_tokens_mistral': 485, 'n_tokens_neox': 459, 'n_words': 175}