<commit_before>//
//  TransformType.swift
//  OMM
//
//  Created by <NAME> on 10/11/15.
//  Copyright © 2015 <NAME>. All rights reserved.
//

/// A type that represents transformation from node to value.
public
protocol TransformType {

    /// Resulting value of transformation.
    typealias Value

    /// Transforms node to value.
    /// - Parameter node: Integer value.
    /// - Returns: Result of transformation.
    func applyToNode(node: NodeType) throws -> Value

}

public
extension TransformType {

    /// Creates an instance of `TransformError` initialized with type of `self`, it's resulting value type and given reason.
    /// - Parameter reason: Explanation of the error reason.
    /// - Returns: Initialized instance of `TransformError`.
    func errorWithReason(reason: String) -> ErrorType {
        return TransformError(transformType: Self.self, targetType: Self.Value.self, reason: reason)
    }

}<commit_msg>Documentation clarification for TransformType<commit_after>//
//  TransformType.swift
//  OMM
//
//  Created by <NAME> on 10/11/15.
//  Copyright © 2015 <NAME>. All rights reserved.
//

/// A type that represents transformation from node to value.
public
protocol TransformType {

    /// Resulting value of transformation.
    typealias Value

    /// Transforms node to value.
    /// - Parameter node: Integer value.
    /// - Returns: Result of transformation.
    /// - Throws: Any user thrown errors.
    func applyToNode(node: NodeType) throws -> Value

}

public
extension TransformType {

    /// Creates an instance of `TransformError` initialized with type of `self`, it's resulting value type and given reason.
    /// - Parameter reason: Explanation of the error reason.
    /// - Returns: Initialized instance of `TransformError`.
    func errorWithReason(reason: String) -> ErrorType {
        return TransformError(transformType: Self.self, targetType: Self.Value.self, reason: reason)
    }

}
{'fraction_non_alphanumeric': 0.1079136690647482, 'fraction_numerical': 0.010277492291880781, 'mean_word_length': 2.863095238095238, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, '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': '4983124', 'n_tokens_mistral': 542, 'n_tokens_neox': 504, 'n_words': 194}