<commit_before>// Copyright 2015 <NAME>. All Rights Reserved.
// Author: <EMAIL> (<NAME>)
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package save

import (
	"os"

	"github.com/jacobsa/comeback/internal/blob"
	"github.com/jacobsa/comeback/internal/state"
)

// A node within the tree defined by the file system hierarchy rooted at a
// particular directory, called the base path below.
type fsNode struct {
	// The path of the file (or directory, etc.) relative to the base path.
	RelPath string

	// Information about the file, as returned by os.Lstat.
	Info os.FileInfo

	// The node for the parent of this file, or nil if this is the root of the
	// tree of interest.
	Parent *fsNode

	// The nodes comprising the children of this directory. Empty for
	// non-directories.
	Children []*fsNode

	// A list of scores reflecting the contents of this file or directory.
	Scores []blob.Score

	// For private use by consultScoreMap and updateScoreMap: if the scores ought
	// to be inserted into the score map after being computed, the key to use
	// when doing so.
	scoreMapKey *state.ScoreMapKey
}
<commit_msg>Retyped save.fsNode.<commit_after>// Copyright 2015 <NAME>. All Rights Reserved.
// Author: <EMAIL> (<NAME>)
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package save

import (
	"github.com/jacobsa/comeback/internal/blob"
	"github.com/jacobsa/comeback/internal/fs"
	"github.com/jacobsa/comeback/internal/state"
)

// A node within the tree defined by the file system hierarchy rooted at a
// particular directory, called the base path below.
type fsNode struct {
	// The path of the file (or directory, etc.) relative to the base path.
	RelPath string

	// Type, size, etc. information about the file.
	Info fs.DirectoryEntry

	// The node for the parent of this file, or nil if this is the root of the
	// tree of interest.
	Parent *fsNode

	// The nodes comprising the children of this directory. Empty for
	// non-directories.
	Children []*fsNode

	// A list of scores reflecting the contents of this file or directory.
	Scores []blob.Score

	// For private use by consultScoreMap and updateScoreMap: if the scores ought
	// to be inserted into the score map after being computed, the key to use
	// when doing so.
	scoreMapKey *state.ScoreMapKey
}

{'fraction_non_alphanumeric': 0.08690367669401398, 'fraction_numerical': 0.004861744150714068, 'mean_word_length': 3.3718459495351927, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2721361', 'n_tokens_mistral': 932, 'n_tokens_neox': 893, 'n_words': 444}