<commit_before>package main

import (
	"bufio"
	"github.com/Symantec/Dominator/lib/mdb"
	"io"
	"log"
	"strings"
)

func loadText(reader io.Reader, logger *log.Logger) (*mdb.Mdb, error) {
	scanner := bufio.NewScanner(reader)
	var newMdb mdb.Mdb
	for scanner.Scan() {
		fields := strings.Fields(scanner.Text())
		if len(fields) > 0 {
			var machine mdb.Machine
			machine.Hostname = fields[0]
			if len(fields) > 1 {
				machine.RequiredImage = fields[1]
				if len(fields) > 2 {
					machine.PlannedImage = fields[2]
				}
			}
			newMdb.Machines = append(newMdb.Machines, machine)
		}
	}
	if err := scanner.Err(); err != nil {
		return nil, err
	}
	return &newMdb, nil
}<commit_msg>Change mdbd text driver to ignore comment lines.<commit_after>package main

import (
	"bufio"
	"github.com/Symantec/Dominator/lib/mdb"
	"io"
	"log"
	"strings"
)

func loadText(reader io.Reader, logger *log.Logger) (*mdb.Mdb, error) {
	scanner := bufio.NewScanner(reader)
	var newMdb mdb.Mdb
	for scanner.Scan() {
		fields := strings.Fields(scanner.Text())
		if len(fields) > 0 {
			if fields[0][0] == '#' {
				continue
			}
			var machine mdb.Machine
			machine.Hostname = fields[0]
			if len(fields) > 1 {
				machine.RequiredImage = fields[1]
				if len(fields) > 2 {
					machine.PlannedImage = fields[2]
				}
			}
			newMdb.Machines = append(newMdb.Machines, machine)
		}
	}
	if err := scanner.Err(); err != nil {
		return nil, err
	}
	return &newMdb, nil
}
{'fraction_non_alphanumeric': 0.1453287197231834, 'fraction_numerical': 0.009688581314878892, 'mean_word_length': 3.3293413173652695, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '1263459', 'n_tokens_mistral': 636, 'n_tokens_neox': 561, 'n_words': 122}