<commit_before>package main

import (
    "github.com/nsf/termbox-go"
    "log"
)

type Apollo struct {
    running bool
    width int
    height int
    events chan termbox.Event
    configuration *Configuration
    database *Database
}

func createApollo() *Apollo {
    width, height := termbox.Size()

    a := &Apollo{
        running: true,
        width: width,
        height: height,
        events: make(chan termbox.Event, 20),
        configuration: createConfiguration(),
        database: createDatabase(),
    }

    return a
}

func (a *Apollo) handleEvent(ev *termbox.Event) error {
    switch ev.Type {
    case termbox.EventKey:
        a.handleKeyEvent(ev)
    case termbox.EventResize:
        a.width, a.height = termbox.Size()
    case termbox.EventError:
        return ev.Err
    }

    return nil
}

func (a *Apollo) handleKeyEvent(ev *termbox.Event) {
    if ev.Key == termbox.KeyCtrlC {
        a.running = false
    }
}

func (a *Apollo) draw() {
    termbox.Flush()
}

func (a *Apollo) loop() {
    go func() {
        for {
            a.events <- termbox.PollEvent()
        }
    }()
    for (a.running) {
        select {
        case ev := <-a.events:
            err := a.handleEvent(&ev)
            if err != nil {
                a.running = false
                log.Fatal(err)
            }
            a.draw()
        }
    }
}

func main() {<commit_msg>Added the top status bar<commit_after>package main

import (
    "github.com/nsf/termbox-go"
    "log"
)

type Apollo struct {
    running bool
    width int
    height int
    events chan termbox.Event
    configuration *Configuration
    database *Database
}

func createApollo() *Apollo {
    width, height := termbox.Size()

    a := &Apollo{
        running: true,
        width: width,
        height: height,
        events: make(chan termbox.Event, 20),
        configuration: createConfiguration(),
        database: createDatabase(),
    }

    return a
}

func (a *Apollo) handleEvent(ev *termbox.Event) error {
    switch ev.Type {
    case termbox.EventKey:
        a.handleKeyEvent(ev)
    case termbox.EventResize:
        a.width, a.height = termbox.Size()
    case termbox.EventError:
        return ev.Err
    }

    return nil
}

func (a *Apollo) handleKeyEvent(ev *termbox.Event) {
    if ev.Key == termbox.KeyCtrlC {
        a.running = false
    }
}

func (a *Apollo) draw() {
    termbox.Clear(termbox.ColorDefault, termbox.ColorDefault)

    runes := []rune("top status bar")
    for i := 0; i < a.width; i++ {
        if i < len(runes) {
            termbox.SetCell(i, 0, runes[i], termbox.ColorWhite | termbox.AttrBold, termbox.ColorBlack | termbox.AttrBold)
        } else {
            termbox.SetCell(i, 0, ' ', termbox.ColorDefault, termbox.ColorBlack | termbox.AttrBold)
        }
    }

    termbox.Flush()
}

func (a *Apollo) loop() {
    go func() {
        for {
            a.events <- termbox.PollEvent()
        }
    }()
    for (a.running) {
        select {
        case ev := <-a.events:
            err := a.handleEvent(&ev)
            if err != nil {
                a.running = false
                log.Fatal(err)
            }
            a.draw()
        }
    }
}

func main() {
{'fraction_non_alphanumeric': 0.1206201550387597, 'fraction_numerical': 0.0021705426356589145, 'mean_word_length': 1.852343059239611, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 3, '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': '1809112', 'n_tokens_mistral': 1084, 'n_tokens_neox': 1040, 'n_words': 248}