names

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package names resolves item, creature, recipe and instance names through the dataset's names.parquet index (see the data repository's docs/schema.md and docs/layout.md), reading only the row groups whose norm range and Bloom filter admit the name. A dataset without the index, and a table the index does not list (quests), are searched by scanning the table's name column.

Index

Constants

View Source
const (
	Items     = "items"
	Npcs      = "npcs"
	Instances = "instances"
	Recipes   = "recipes"
	ItemSets  = "item_sets"
)

Tables the index lists, as its table column spells them.

Variables

This section is empty.

Functions

func Normalize

func Normalize(s string) string

Normalize lowercases a name, folds accents (é to e), drops apostrophes and turns every other run of non-letters and non-digits into one space, trimmed at both ends. It is how names.parquet's norm column is built.

func Resolve

func Resolve(ds store.DataStore, table, text string) (id int64, name string, candidates []string)

Resolve turns a name into one row of table: a name that matches one row gives its id and name; otherwise it returns the candidates as "name (id)" and id 0, none when nothing matches.

Types

type Match

type Match struct {
	ID   int64
	Name string
}

Match is one named row: its id in the table (items.id, npcs.id, instances.map_id, recipes.spell_id, item_sets.set_id) and its name as the table spells it.

func Find

func Find(ds store.DataStore, table, text string, limit int) (hits []Match, more bool, err error)

Find returns up to limit rows of table named text: those whose normalised name equals the normalised text, else those that start with it, in index order. more is true when the limit cut the list. Text with no letter or digit finds nothing.

func ObtainableFirst

func ObtainableFirst(hits []Match) []Match

ObtainableFirst drops the unobtainable items from a list of item matches when any obtainable one is there, so a search by part of a name never offers a placeholder beside the real item. A list of only unobtainable items is kept, so the tool can say the item cannot be had.

Jump to

Keyboard shortcuts

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