ranking

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 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 RankItem

type RankItem[T any] struct {
	Item Rankable[T]
}

RankItem wraps a rankable item for display

func RankByValue

func RankByValue[T any](items []Rankable[T], topN int) []RankItem[T]

RankByValue ranks items by their ranking value in descending order

func (RankItem[T]) String

func (r RankItem[T]) String() string

type Rankable

type Rankable[T any] interface {
	GetValue() T
	GetRankingValue() int
}

Rankable represents anything that can be ranked

Jump to

Keyboard shortcuts

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