<commit_before>// Subscript
import Cocoa
<commit_msg>First simple subscript<commit_after>// Subscript
/*
Classes, structures, and enumerations can define subscripts, which are
shortcuts for accessing the member elements of a collection, list, or
sequence. You use subscripts to set and retrieve values by index without
needing separate methods for setting and retrieval. 

For example, you access
elements in an Array instance as someArray[index] and elements in a
Dictionary instance as someDictionary[key].

*/
import Cocoa

struct TimesTable{
    let multiplier: Int
    
    subscript(index:Int) -> Int{
        return multiplier * index
    }
}

var timesTableInstance = TimesTable(multiplier: 3)
var subscriptResult = timesTableInstance[6] // Expecting 18
println(subscriptResult)

{'fraction_non_alphanumeric': 0.062261753494282084, 'fraction_numerical': 0.005082592121982211, 'mean_word_length': 4.628571428571429, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '927735', 'n_tokens_mistral': 214, 'n_tokens_neox': 203, 'n_words': 88}