recommend

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package recommend computes static related-article rankings for public notes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(idx *model.VaultIndex, graph *model.LinkGraph, limit int) (map[string][]RankedNote, error)

Build computes the top-N related notes for every public note in the index.

func Tokenize

func Tokenize(text string) ([]string, error)

Tokenize splits mixed-language note content into normalized terms. CJK spans are segmented with gse, while non-CJK spans are split only on whitespace so engineering terms like node.js or path/to/file stay intact.

Types

type BM25

type BM25 struct {
	// contains filtered or unexported fields
}

type RankedNote

type RankedNote struct {
	Note  *model.Note
	Score float64
}

RankedNote contains one related-note candidate and its final ranking score.

type Recommender

type Recommender struct {
	// contains filtered or unexported fields
}

Recommender holds the prebuilt corpus and note metadata used for ranking.

func New

func New(idx *model.VaultIndex, graph *model.LinkGraph) (*Recommender, error)

New constructs a reusable recommender over the current public-note corpus.

func (*Recommender) Related

func (r *Recommender) Related(note *model.Note, limit int) []RankedNote

Related ranks other public notes for a given source note.

Jump to

Keyboard shortcuts

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