<commit_before>//
//  Documentation.swift
//  SwiftDocDigger
//

/// A documentation node.
public struct DocumentationNode {
    public enum Element {
        case Text(String)
        case Paragraph
        case CodeVoice
        case Emphasis
        case Strong
        case Bold
        case RawHTML(String)
        case Link(href: String)
        case BulletedList
        case NumberedList
        case ListItem
        case CodeBlock(language: String?)
        case NumberedCodeLine
        /// A label, usually written as `- Label: ...` in the comment.
        /// Used to store labels like 'note', 'requirements', etc.
        case Label(String)
        /// Unknown documentation element, possibly a custom label like `- MyLabel: ...`.
        case Other(String)
    }
    public let element: Element
    public let children: [DocumentationNode]

    public init(element: Element, children: [DocumentationNode] = []) {
        self.element = element
        self.children = children
    }
}

/// Documentation for a Swift's declaration.
public struct Documentation {
    public struct Parameter {
        public let name: String
        public let discussion: [DocumentationNode]?
    }

    public let declaration: [DocumentationNode]?
    public let abstract: [DocumentationNode]?
    public let discussion: [DocumentationNode]?
    public let parameters: [Parameter]?
    public let resultDiscussion: [DocumentationNode]?
}
<commit_msg>Add public initializer to Documentation<commit_after>//
//  Documentation.swift
//  SwiftDocDigger
//

/// A documentation node.
public struct DocumentationNode {
    public enum Element {
        case Text(String)
        case Paragraph
        case CodeVoice
        case Emphasis
        case Strong
        case Bold
        case RawHTML(String)
        case Link(href: String)
        case BulletedList
        case NumberedList
        case ListItem
        case CodeBlock(language: String?)
        case NumberedCodeLine
        /// A label, usually written as `- Label: ...` in the comment.
        /// Used to store labels like 'note', 'requirements', etc.
        case Label(String)
        /// Unknown documentation element, possibly a custom label like `- MyLabel: ...`.
        case Other(String)
    }
    public let element: Element
    public let children: [DocumentationNode]

    public init(element: Element, children: [DocumentationNode] = []) {
        self.element = element
        self.children = children
    }
}

/// Documentation for a Swift's declaration.
public struct Documentation {
    public struct Parameter {
        public let name: String
        public let discussion: [DocumentationNode]?
    }

    public let declaration: [DocumentationNode]?
    public let abstract: [DocumentationNode]?
    public let discussion: [DocumentationNode]?
    public let parameters: [Parameter]?
    public let resultDiscussion: [DocumentationNode]?

    public init(declaration: [DocumentationNode]?, abstract: [DocumentationNode]?, discussion: [DocumentationNode]?, parameters: [Parameter]?, resultDiscussion: [DocumentationNode]?) {
        self.declaration = declaration
        self.abstract = abstract
        self.discussion = discussion
        self.parameters = parameters
        self.resultDiscussion = resultDiscussion
    }
}

{'fraction_non_alphanumeric': 0.08582653369598066, 'fraction_numerical': 0.0, 'mean_word_length': 2.5325506937033087, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1863797', 'n_tokens_mistral': 845, 'n_tokens_neox': 817, 'n_words': 277}