<commit_before>package core

import (
	"github.com/robfig/config"
	"strconv"
)

func initConfig() error {
	var err error
	Cfg = make(map[string]string)
	SysCfg = make(map[string]string)

	c, err := config.ReadDefault(".config")
	configs, err := c.Options("default")
	if err != nil {
		return err
	}

	for _, value := range configs {
		SysCfg[value], err = c.String("default", value)
	}

	return err
}
func GetSysConfigInt(name string) int {
	res, _ := strconv.Atoi(SysCfg[name])
	return res
}
func GetConfigInt(name string) int {
	res, _ := strconv.Atoi(Cfg[name])
	return res
}
func GetConfigFloat(name string) float64 {
	res, _ := strconv.ParseFloat(Cfg[name], 64)
	return res<commit_msg>Added check for config file not existing<commit_after>package core

import (
	"github.com/robfig/config"
	"strconv"
)

func initConfig() error {
	var err error
	Cfg = make(map[string]string)
	SysCfg = make(map[string]string)

	c, err := config.ReadDefault(".config")
	if err != nil {
		Error.Fatal("Could not open config file. Please run 'nebuleuse install' to generate one")
		return err
	}
	configs, err := c.Options("default")
	if err != nil {
		return err
	}

	for _, value := range configs {
		SysCfg[value], err = c.String("default", value)
	}

	return err
}
func GetSysConfigInt(name string) int {
	res, _ := strconv.Atoi(SysCfg[name])
	return res
}
func GetConfigInt(name string) int {
	res, _ := strconv.Atoi(Cfg[name])
	return res
}
func GetConfigFloat(name string) float64 {
	res, _ := strconv.ParseFloat(Cfg[name], 64)
	return res
{'fraction_non_alphanumeric': 0.13577023498694518, 'fraction_numerical': 0.005221932114882507, 'mean_word_length': 4.41696113074205, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4066997', 'n_tokens_mistral': 569, 'n_tokens_neox': 548, 'n_words': 144}