divido

package module
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2023 License: MIT Imports: 7 Imported by: 1

README

divido

Golang module to divide text books into chunks suitable for audio synthesis

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultNotesFilename added in v0.1.6

func DefaultNotesFilename(filename string) string

func NewTranslationPatch added in v0.1.7

func NewTranslationPatch(lines ...string) *translationPatch

Types

type ElementType

type ElementType int
const (
	Paragraph ElementType = iota
	Break
	ChapterTitle
)

type TextDocument

type TextDocument []TextElement

func NewTextDocument

func NewTextDocument(reader io.Reader) TextDocument

func NewTextDocumentWithNotes added in v0.1.6

func NewTextDocumentWithNotes(document io.Reader, notes io.Reader) TextDocument

func (TextDocument) ChapterParagraphs

func (td TextDocument) ChapterParagraphs(chapterTitle string) []TextParagraph

func (TextDocument) ChapterTitles

func (td TextDocument) ChapterTitles() []string

func (TextDocument) ReplaceFrom added in v0.1.6

func (td TextDocument) ReplaceFrom(start int, old, new string) int

type TextElement

type TextElement struct {
	Content []TextParagraph
	Type    ElementType
}

type TextParagraph

type TextParagraph string

func NewParagraphs

func NewParagraphs(p string) []TextParagraph

func (TextParagraph) Sentences

func (tp TextParagraph) Sentences() []string

func (TextParagraph) String

func (tp TextParagraph) String() string

Jump to

Keyboard shortcuts

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