Documentation
¶
Overview ¶
Package util holds small shared helpers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsCJKFunctionWord ¶
IsCJKFunctionWord reports whether w is a single-ideograph Chinese function word (a high-frequency word with little retrieval signal). Multi-character strings are never function words.
func IsStopword ¶
IsStopword reports whether a lowercase token is a function word (Latin or CJK) that carries no retrieval signal on its own. Retrievers skip these so a match on a common word alone does not trigger a false positive.
func Tokenize ¶
Tokenize splits text into lowercase word tokens for lexical matching: runs of Latin letters/digits become one token, and each CJK ideograph stands alone (Chinese has no word boundaries, so single ideographs give the overlap signal needed for short-entry retrieval). It is a retrieval heuristic, not a linguistic tokenizer.
func UUIDv7 ¶
UUIDv7 returns a time-ordered 128-bit identifier per RFC 9562.
Layout: 48-bit Unix millisecond timestamp | 0b0111 (version) | 12 random bits | 0b10 (variant) | 62 random bits. Values sort lexically by creation time, which keeps task rows append-friendly. Uniqueness comes from 74 random bits, sufficient for the idempotency-key use case in this system.
func WriteFileAtomic ¶
WriteFileAtomic writes data to path atomically: the content goes to a temp file in the same directory, is fsynced, and then renamed over path (P1-20). An in-place os.WriteFile leaves a truncated file behind when the process dies mid-write; a same-directory rename is atomic on POSIX and Windows, so readers only ever see the old or the new content, never a torn mix.
Types ¶
This section is empty.