<commit_before>package model

// NewTable create a new table with the given name
func NewTable(name string) Table {
	return &table{
		name: name,
	}
}

func (t *table) ID() string {
	return "table#" + t.name
}

func (t *table) LookupColumn(name string) (TableColumn, int, bool) {
	var order int
	for col := range t.Columns() {
		if col.ID() == name {
			return col, order, true
		}
		order++
	}
	return nil, 0, false
}

func (t *table) LookupIndex(id string) (Index, bool) {
	for idx := range t.Indexes() {
		if idx.ID() == id {
			return idx, true
		}
	}
	return nil, false
}

func (t *table) LookupOrderColumn(order int) (TableColumn, bool) {
	var count int
	for col := range t.Columns() {
		if count == order {
			return col, true
		}
		count++
	}
	return nil, false
}

func (t *table) AddColumn(v TableColumn) Table {
	// Avoid adding the same TableColumn to multiple tables
	if tblID := v.TableID(); tblID != "" {
		v = v.Clone()
	}<commit_msg>Fix variable name.<commit_after>package model

// NewTable create a new table with the given name
func NewTable(name string) Table {
	return &table{
		name: name,
	}
}

func (t *table) ID() string {
	return "table#" + t.name
}

func (t *table) LookupColumn(name string) (TableColumn, int, bool) {
	var order int
	for col := range t.Columns() {
		if col.ID() == name {
			return col, order, true
		}
		order++
	}
	return nil, 0, false
}

func (t *table) LookupIndex(id string) (Index, bool) {
	for idx := range t.Indexes() {
		if idx.ID() == id {
			return idx, true
		}
	}
	return nil, false
}

func (t *table) LookupOrderColumn(num int) (TableColumn, bool) {
	var order int
	for col := range t.Columns() {
		if order == num {
			return col, true
		}
		order++
	}
	return nil, false
}

func (t *table) AddColumn(v TableColumn) Table {
	// Avoid adding the same TableColumn to multiple tables
	if tblID := v.TableID(); tblID != "" {
		v = v.Clone()
	}
{'fraction_non_alphanumeric': 0.1395471300684571, 'fraction_numerical': 0.00105318588730911, 'mean_word_length': 3.279279279279279, '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': '1402945', 'n_tokens_mistral': 725, 'n_tokens_neox': 687, 'n_words': 238}