<commit_before>//
//  SyntaxToken.swift
//  SourceKitten
//
//  Created by <NAME> on 2015-01-03.
//  Copyright (c) 2015 SourceKitten. All rights reserved.
//

/// Represents a single Swift syntax token.
public struct SyntaxToken {
    /// Token type. See SyntaxKind.
    public let type: String
    /// Token offset.
    public let offset: Int
    /// Token length.
    public let length: Int

    /// Dictionary representation of SyntaxToken. Useful for NSJSONSerialization.
    public var dictionaryValue: [String: AnyObject] {
        return ["type": type, "offset": offset, "length": length]
    }

    /**
    Create a SyntaxToken by directly passing in its property values.

    - parameter type:   Token type. See SyntaxKind.
    - parameter offset: Token offset.
    - parameter length: Token length.
    */
    public init(type: String, offset: Int, length: Int) {
        self.type = type<commit_msg>Make comparison faster between `SyntaxToken.type` and `SyntaxKind.rawValue`<commit_after>//
//  SyntaxToken.swift
//  SourceKitten
//
//  Created by <NAME> on 2015-01-03.
//  Copyright (c) 2015 SourceKitten. All rights reserved.
//

/// Represents a single Swift syntax token.
public struct SyntaxToken {
    /// Token type. See SyntaxKind.
    public let type: String
    /// Token offset.
    public let offset: Int
    /// Token length.
    public let length: Int

    /// Dictionary representation of SyntaxToken. Useful for NSJSONSerialization.
    public var dictionaryValue: [String: AnyObject] {
        return ["type": type, "offset": offset, "length": length]
    }

    /**
    Create a SyntaxToken by directly passing in its property values.

    - parameter type:   Token type. See SyntaxKind.
    - parameter offset: Token offset.
    - parameter length: Token length.
    */
    public init(type: String, offset: Int, length: Int) {
        self.type = SyntaxKind(rawValue: type)?.rawValue ?? type
{'fraction_non_alphanumeric': 0.10874089490114464, 'fraction_numerical': 0.012486992715920915, 'mean_word_length': 2.621468926553672, 'pattern_counts': {'":': 6, '<': 5, '<?xml version=': 0, '>': 5, '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': '816503', 'n_tokens_mistral': 563, 'n_tokens_neox': 532, 'n_words': 199}