<commit_before>// Copyright 2013 <NAME>. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package repository

import (
	"github.com/andreaskoch/allmark/config"
	"github.com/andreaskoch/allmark/util"
	"path/filepath"
	"strings"
)

var (
	ReservedDirectoryNames = []string{FilesDirectoryName, config.MetaDataFolderName}
)

func isReservedDirectory(path string) bool {
	if isDirectory, _ := util.IsDirectory(path); !isDirectory {
		return false
	}

	directoryName := strings.ToLower(filepath.Base(path))
	for _, reservedDirectoryName := range ReservedDirectoryNames {
		if directoryName == strings.ToLower(reservedDirectoryName) {
			return true
		}
	}

	return false
}
<commit_msg>Updated the reserved directory check. All dot-directories should be ignored.<commit_after>// Copyright 2013 <NAME>. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package repository

import (
	"github.com/andreaskoch/allmark/config"
	"github.com/andreaskoch/allmark/util"
	"path/filepath"
	"strings"
)

var (
	ReservedDirectoryNames = []string{FilesDirectoryName, config.MetaDataFolderName}
)

func isReservedDirectory(path string) bool {
	if isDirectory, _ := util.IsDirectory(path); !isDirectory {
		return false
	}

	// get the directory name
	directoryName := strings.ToLower(filepath.Base(path))

	// all dot-directories are ignored
	if strings.HasPrefix(directoryName, ".") {
		return true
	}

	// check the reserved directory names
	for _, reservedDirectoryName := range ReservedDirectoryNames {
		if directoryName == strings.ToLower(reservedDirectoryName) {
			return true
		}
	}

	return false
}

{'fraction_non_alphanumeric': 0.09942528735632183, 'fraction_numerical': 0.004597701149425287, 'mean_word_length': 4.5094936708860756, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6842999', 'n_tokens_mistral': 545, 'n_tokens_neox': 519, 'n_words': 146}