<commit_before>package main

import (
	"encoding/json"
	"fmt"
	"io"
	"io/ioutil"
	"log"
	"os"
	"os/exec"
	"path/filepath"
	"runtime"
	"strconv"
)

type FactorioServer struct {
	Cmd      *exec.Cmd              `json:"-"`
	Savefile string                 `json:"-"`
	Latency  int                    `json:"latency"`
	Port     int                    `json:"port"`
	Running  bool                   `json:"running"`
	StdOut   io.ReadCloser          `json:"-"`
	StdErr   io.ReadCloser          `json:"-"`
	StdIn    io.WriteCloser         `json:"-"`
	Settings map[string]interface{} `json:"-"`
}

func initFactorio() (f *FactorioServer, err error) {
	f = new(FactorioServer)
	f.Settings = make(map[string]interface{})

	if err = os.MkdirAll(config.FactorioConfigDir, 0755); err != nil {
		return nil, fmt.Errorf("failed to create config directory: %v", err)
	}

	settingsPath := filepath.Join(config.FactorioConfigDir, config.SettingsFile)
	var settings *os.File

	if _, err := os.Stat(settingsPath); os.IsNotExist(err) {<commit_msg>fixed missing savefile json definition<commit_after>package main

import (
	"encoding/json"
	"fmt"
	"io"
	"io/ioutil"
	"log"
	"os"
	"os/exec"
	"path/filepath"
	"runtime"
	"strconv"
)

type FactorioServer struct {
	Cmd      *exec.Cmd              `json:"-"`
	Savefile string                 `json:"savefile"`
	Latency  int                    `json:"latency"`
	Port     int                    `json:"port"`
	Running  bool                   `json:"running"`
	StdOut   io.ReadCloser          `json:"-"`
	StdErr   io.ReadCloser          `json:"-"`
	StdIn    io.WriteCloser         `json:"-"`
	Settings map[string]interface{} `json:"-"`
}

func initFactorio() (f *FactorioServer, err error) {
	f = new(FactorioServer)
	f.Settings = make(map[string]interface{})

	if err = os.MkdirAll(config.FactorioConfigDir, 0755); err != nil {
		return nil, fmt.Errorf("failed to create config directory: %v", err)
	}

	settingsPath := filepath.Join(config.FactorioConfigDir, config.SettingsFile)
	var settings *os.File

	if _, err := os.Stat(settingsPath); os.IsNotExist(err) {
{'fraction_non_alphanumeric': 0.14347408829174665, 'fraction_numerical': 0.003838771593090211, 'mean_word_length': 2.709964412811388, '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': '6502530', 'n_tokens_mistral': 737, 'n_tokens_neox': 714, 'n_words': 160}