<commit_before>//
//  ArgumentsArray.swift
//  Commandant
//
//  Created by <NAME> on 27/11/2016.
//  Copyright © 2016 Carthage. All rights reserved.
//

import Foundation

/// Represents an array of arguments that are converted from the given string
/// Using comma as a separator
/// E.g. "banana, apple, peach" -> ["banana", "apple", "peach"]
struct ArgumentsArray: ArgumentProtocol {
	/// Array of arguments that were passed by a comma separated string
	public let arguments: Array<String>
	
	/// Separator to be used to split string into values
	private static let separator = ","
	
	public static let name = "array"
	
	public static func from(string: String) -> ArgumentsArray? {
		let trimmedComponents = string.components(separatedBy: separator).map { $0.trimmingCharacters(in: .whitespacesAndNewlines) }
		if trimmedComponents.count > 1 {
			return ArgumentsArray(arguments: trimmedComponents)
		}
		return string.rangeOfCharacter(from: .whitespaces) == nil ? ArgumentsArray(arguments: [string]) : nil
	}
}

extension ArgumentsArray: Equatable {
	public static func ==(lhs: ArgumentsArray, rhs: ArgumentsArray) -> Bool {
		return lhs.arguments == rhs.arguments
	}
}<commit_msg>Update for code style guide;<commit_after>//
//  ArgumentsArray.swift
//  Commandant
//
//  Created by <NAME> on 27/11/2016.
//  Copyright © 2016 Carthage. All rights reserved.
//

import Foundation

/// Represents an array of arguments that are converted from the given string
/// Using comma as a separator
/// E.g. "banana, apple, peach" -> ["banana", "apple", "peach"]
struct ArgumentsArray: ArgumentProtocol {
	/// Array of arguments that were passed by a comma separated string
	public let arguments: Array<String>

	/// Separator to be used to split string into values
	private static let separator = ","

	public static let name = "array"

	public static func from(string: String) -> ArgumentsArray? {
		let trimmedComponents = string.components(separatedBy: separator).map { $0.trimmingCharacters(in: .whitespacesAndNewlines) }
		if trimmedComponents.count > 1 {
			return ArgumentsArray(arguments: trimmedComponents)
		}
		return string.rangeOfCharacter(from: .whitespaces) == nil ? ArgumentsArray(arguments: [string]) : nil
	}
}

extension ArgumentsArray: Equatable {
	public static func ==(lhs: ArgumentsArray, rhs: ArgumentsArray) -> Bool {
		return lhs.arguments == rhs.arguments
	}
}
{'fraction_non_alphanumeric': 0.11199664429530201, 'fraction_numerical': 0.01174496644295302, 'mean_word_length': 4.074468085106383, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 15, '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': '2257740', 'n_tokens_mistral': 743, 'n_tokens_neox': 673, 'n_words': 236}