score

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package score provides utilities for scoring and selecting items based on multiple criteria.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Scores

type Scores[T any] []struct {
	Item  T
	Score int
}

Scores holds items with their calculated scores.

func Score

func Score[T any](items []T, scorers ...func(T) int) Scores[T]

Score calculates scores for all items using the provided scoring functions.

func (Scores[T]) Top

func (s Scores[T]) Top() Scores[T]

Top returns all items with the highest score.

Jump to

Keyboard shortcuts

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