text

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package text is small helpers for wording that more than one tool needs: the first sentence of a description, its first line, the article a word takes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Article

func Article(word string) string

Article is the article a word takes, "an" or "a", by its first letter: an indexer, a notification. It knows nothing of how a word sounds, so "an user" is for the caller to word around.

func FirstLine

func FirstLine(s string) string

FirstLine is the first line of s that has anything on it, without the spaces around it.

func FirstSentence

func FirstSentence(s string) string

FirstSentence is s cut to its opening sentence on its first line, ending as a sentence ends: for a list one line each, or a comment drawn from an API's description. The full stop of an abbreviation does not end it: "a url (e.g. from item_cover_search)" was once cut at "(e.g.".

Types

This section is empty.

Jump to

Keyboard shortcuts

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