<commit_before>/*
 * MIT License
 * Copyright (c) 2016 <NAME>
 */
package com.puhlen.interactive

class Menu(){
    var title = ""
    private var items: MutableList<MenuItem> = mutableListOf()
    fun addItem(item: MenuItem):Boolean{
        return items.add(item)
    }

    fun render(){
        Output.printStream.println(title)
        for(i in items){
            Output.printStream.println(i.message)
        }
    }
}

class MenuItem(val message: String){
    var SelectionHandler:SelectionHandler = DefaultSelectionHandler;
}

interface SelectionHandler{
    fun select();
}

object DefaultSelectionHandler:SelectionHandler{
    override fun select() {}
}<commit_msg>Menu now renders item numbers for menuitems<commit_after>/*
 * MIT License
 * Copyright (c) 2016 <NAME>
 */
package com.puhlen.interactive

class Menu(){
    var title = ""
    private var items: MutableList<MenuItem> = mutableListOf()
    fun addItem(item: MenuItem):Boolean{
        return items.add(item)
    }

    fun render(){
        Output.printStream.println(title)
        for(i in items.indices){
            Output.printStream.println("${i+1}) ${items[i]}")
        }
    }
}

class MenuItem(val message: String){
    var selectionHandler:SelectionHandler = DefaultSelectionHandler;
    internal fun select(){
        selectionHandler.select()
    }
    override fun toString(): String{
        return message
    }

}

interface SelectionHandler{
    fun select();
}

object DefaultSelectionHandler:SelectionHandler{
    override fun select() {}
}
{'fraction_non_alphanumeric': 0.11197916666666667, 'fraction_numerical': 0.005859375, 'mean_word_length': 3.154054054054054, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '3740599', 'n_tokens_mistral': 444, 'n_tokens_neox': 433, 'n_words': 109}