classifier

package
v0.0.1-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 28, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Classification

type Classification struct {
	Language    string
	IsGenerated bool
	IsTest      bool
	Excluded    bool
}

Classification describes how a file should be treated by the indexer.

func Classify

func Classify(path string, content string, cfg Config) Classification

Classify combines path-based and content-based classification. If the path indicates exclusion, content is not inspected.

func ClassifyContent

func ClassifyContent(content string, cfg Config) Classification

ClassifyContent classifies a file based on the first ~512 bytes of its content.

func ClassifyPath

func ClassifyPath(path string, cfg Config) Classification

ClassifyPath classifies a file based on its path alone.

type Config

type Config struct {
	ExcludePatterns  []string
	GeneratedMarkers []string
}

Config controls which patterns are used for classification.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns the standard exclude patterns and generated markers.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL