mdtext

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountCharacters

func CountCharacters(text string) int

CountCharacters counts letters and digits in text (no spaces or punctuation).

func CountSentences

func CountSentences(text string) int

CountSentences counts sentences by splitting on sentence-ending punctuation (., !, ?) followed by whitespace or end of text. Returns at least 1 for non-empty text.

func CountWords

func CountWords(text string) int

CountWords counts words in text by splitting on whitespace.

func ExtractPlainText

func ExtractPlainText(node ast.Node, source []byte) string

ExtractPlainText extracts readable text from a goldmark AST node, stripping markdown syntax. Keeps: text content, link display text, emphasis inner text, image alt text, code span text.

func SplitSentences

func SplitSentences(text string) []string

SplitSentences splits text into individual sentences using a Punkt sentence tokenizer. Handles abbreviations, decimals, and ellipses.

Types

This section is empty.

Jump to

Keyboard shortcuts

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