identtoken

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package identtoken is the one place search text turns into tokens: Fields cuts free text into identifier-like terms, and Split cuts one identifier into its sub-tokens. It is a leaf utility shared by search indexing, query sanitizing, and both scorers, because two copies of a tokenizer is how a query and the index it searches stop reading text the same way.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fields added in v0.13.0

func Fields(text string) []string

Fields splits free text into identifier-like terms with their original case, so camelCase boundaries survive for sub-token splitting by Split. @intent expose original-case terms; lowercasing happens per consumer. @domainRule only letter, digit, and underscore sequences survive tokenization.

func FieldsLower added in v0.13.0

func FieldsLower(text string) []string

FieldsLower splits free text into lowercase identifier-like terms, which is how both indexed documents and the queries aimed at them are read. @intent read a document the same way the query is read.

func Split

func Split(s string) []string

Split breaks an identifier into lowercased sub-tokens on separators, camelCase boundaries, and letter/digit transitions ("getUserById" -> get, user, by, id; "HTTPServer" -> http, server; "parseHTML5" -> parse, html, 5). @intent normalize source identifiers into stable search-index tokens without language-specific dependencies.

Types

This section is empty.

Jump to

Keyboard shortcuts

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