Documentation ¶
Overview ¶
Text manipulation and transformation.
Index ¶
- Variables
- func Register(reg func(any))
- type Capitalize
- type Capitalize_Slice
- type FindText
- type FindText_Slice
- type IsNothing
- type IsNothing_Slice
- type Join
- type Join_Slice
- type MakeLowercase
- type MakeLowercase_Slice
- type MakeReversed
- type MakeReversed_Slice
- type MakeSentenceCase
- type MakeSentenceCase_Slice
- type MakeTitleCase
- type MakeTitleCase_Slice
- type MakeUppercase
- type MakeUppercase_Slice
- type MatchCache
- type Matches
- type Matches_Slice
- type Pluralize
- type Pluralize_Slice
- type Singularize
- type Singularize_Slice
- type SplitLines
- type SplitLines_Slice
- type SplitText
- type SplitText_Slice
- type SplitWords
- type SplitWords_Slice
- type TextEndsWith
- type TextEndsWith_Slice
- type TextLen
- type TextLen_Slice
- type TextStartsWith
- type TextStartsWith_Slice
Constants ¶
This section is empty.
Variables ¶
var Z_Types = typeinfo.TypeSet{ Name: "text", Comment: []string{ "Text manipulation and transformation.", }, Flow: z_flow_list, Signatures: z_signatures, }
package listing of type data
var Zt_Capitalize typeinfo.Flow
capitalize, a type of flow.
var Zt_FindText typeinfo.Flow
find_text, a type of flow.
var Zt_IsNothing typeinfo.Flow
is_nothing, a type of flow.
var Zt_Join typeinfo.Flow
join, a type of flow.
var Zt_MakeLowercase typeinfo.Flow
make_lowercase, a type of flow.
var Zt_MakeReversed typeinfo.Flow
make_reversed, a type of flow.
var Zt_MakeSentenceCase typeinfo.Flow
make_sentence_case, a type of flow.
var Zt_MakeTitleCase typeinfo.Flow
make_title_case, a type of flow.
var Zt_MakeUppercase typeinfo.Flow
make_uppercase, a type of flow.
var Zt_Matches typeinfo.Flow
matches, a type of flow.
var Zt_Pluralize typeinfo.Flow
pluralize, a type of flow.
var Zt_Singularize typeinfo.Flow
singularize, a type of flow.
var Zt_SplitLines typeinfo.Flow
split_lines, a type of flow.
var Zt_SplitText typeinfo.Flow
split_text, a type of flow.
var Zt_SplitWords typeinfo.Flow
split_words, a type of flow.
var Zt_TextEndsWith typeinfo.Flow
text_ends_with, a type of flow.
var Zt_TextLen typeinfo.Flow
text_len, a type of flow.
var Zt_TextStartsWith typeinfo.Flow
text_starts_with, a type of flow.
Functions ¶
Types ¶
type Capitalize ¶
Copy some text, changing its first letter to uppercase.
func (*Capitalize) GetMarkup ¶
func (op *Capitalize) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
type Capitalize_Slice ¶
type Capitalize_Slice []Capitalize
Holds a slice of type Capitalize.
func (*Capitalize_Slice) Repeats ¶
func (op *Capitalize_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of Capitalize.
func (*Capitalize_Slice) TypeInfo ¶
func (*Capitalize_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of Capitalize.
type FindText ¶
type FindText struct { Text rtti.TextEval Subtext rtti.TextEval Markup map[string]any `json:",omitempty"` }
Determine whether one piece of text contains a second piece of text.
The rt.NumEval version returns the first index at which the text appears, or zero if not found.
func (*FindText) GetMarkup ¶
Implements typeinfo.Markup
type FindText_Slice ¶
type FindText_Slice []FindText
Holds a slice of type FindText.
func (*FindText_Slice) Repeats ¶
func (op *FindText_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of FindText.
func (*FindText_Slice) TypeInfo ¶
func (*FindText_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of FindText.
type IsNothing ¶
Determine whether text is completely without content. Even spaces are considered content. The text "" is considered nothing, The text " " is considered something.
func (*IsNothing) GetMarkup ¶
Implements typeinfo.Markup
type IsNothing_Slice ¶
type IsNothing_Slice []IsNothing
Holds a slice of type IsNothing.
func (*IsNothing_Slice) Repeats ¶
func (op *IsNothing_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of IsNothing.
func (*IsNothing_Slice) TypeInfo ¶
func (*IsNothing_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of IsNothing.
type Join ¶
type Join struct { Sep rtti.TextEval Parts []rtti.TextEval Markup map[string]any `json:",omitempty"` }
Combine text to produce new text.
func (*Join) GetMarkup ¶
Implements typeinfo.Markup
type Join_Slice ¶
type Join_Slice []Join
Holds a slice of type Join.
func (*Join_Slice) Repeats ¶
func (op *Join_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of Join.
func (*Join_Slice) TypeInfo ¶
func (*Join_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of Join.
type MakeLowercase ¶
Copy some text, changing every letter into lowercase. For example, turns "QUIET" into "quiet.
func (*MakeLowercase) GetMarkup ¶
func (op *MakeLowercase) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
func (*MakeLowercase) TypeInfo ¶
func (*MakeLowercase) TypeInfo() typeinfo.T
Implements typeinfo.Instance
type MakeLowercase_Slice ¶
type MakeLowercase_Slice []MakeLowercase
Holds a slice of type MakeLowercase.
func (*MakeLowercase_Slice) Repeats ¶
func (op *MakeLowercase_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of MakeLowercase.
func (*MakeLowercase_Slice) TypeInfo ¶
func (*MakeLowercase_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of MakeLowercase.
type MakeReversed ¶
Copy some text with its contents flipped back to front. For example, turns "Tapestry" into 'yrtsepaT'.
func (*MakeReversed) GetMarkup ¶
func (op *MakeReversed) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
func (*MakeReversed) TypeInfo ¶
func (*MakeReversed) TypeInfo() typeinfo.T
Implements typeinfo.Instance
type MakeReversed_Slice ¶
type MakeReversed_Slice []MakeReversed
Holds a slice of type MakeReversed.
func (*MakeReversed_Slice) Repeats ¶
func (op *MakeReversed_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of MakeReversed.
func (*MakeReversed_Slice) TypeInfo ¶
func (*MakeReversed_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of MakeReversed.
type MakeSentenceCase ¶
Copy text, changing the start of each sentence so that it starts with a capital letter. ( Currently, "sentences" are considered to be a series of characters ending with a full-stop followed by a space. ) For example, "see the doctor run. run doctor. run." into "See the doctor run. Run doctor. Run."
func (*MakeSentenceCase) GetMarkup ¶
func (op *MakeSentenceCase) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
func (*MakeSentenceCase) TypeInfo ¶
func (*MakeSentenceCase) TypeInfo() typeinfo.T
Implements typeinfo.Instance
type MakeSentenceCase_Slice ¶
type MakeSentenceCase_Slice []MakeSentenceCase
Holds a slice of type MakeSentenceCase.
func (*MakeSentenceCase_Slice) Repeats ¶
func (op *MakeSentenceCase_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of MakeSentenceCase.
func (*MakeSentenceCase_Slice) TypeInfo ¶
func (*MakeSentenceCase_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of MakeSentenceCase.
type MakeTitleCase ¶
Copy some text, making every word start with a capital letter. For example, turns "empire apple" into "Empire Apple".
func (*MakeTitleCase) GetMarkup ¶
func (op *MakeTitleCase) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
func (*MakeTitleCase) TypeInfo ¶
func (*MakeTitleCase) TypeInfo() typeinfo.T
Implements typeinfo.Instance
type MakeTitleCase_Slice ¶
type MakeTitleCase_Slice []MakeTitleCase
Holds a slice of type MakeTitleCase.
func (*MakeTitleCase_Slice) Repeats ¶
func (op *MakeTitleCase_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of MakeTitleCase.
func (*MakeTitleCase_Slice) TypeInfo ¶
func (*MakeTitleCase_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of MakeTitleCase.
type MakeUppercase ¶
Copy some text, changing every letter into uppercase. For example, transforms "loud" into "LOUD".
func (*MakeUppercase) GetMarkup ¶
func (op *MakeUppercase) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
func (*MakeUppercase) TypeInfo ¶
func (*MakeUppercase) TypeInfo() typeinfo.T
Implements typeinfo.Instance
type MakeUppercase_Slice ¶
type MakeUppercase_Slice []MakeUppercase
Holds a slice of type MakeUppercase.
func (*MakeUppercase_Slice) Repeats ¶
func (op *MakeUppercase_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of MakeUppercase.
func (*MakeUppercase_Slice) TypeInfo ¶
func (*MakeUppercase_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of MakeUppercase.
type MatchCache ¶
type MatchCache struct {
// contains filtered or unexported fields
}
type Matches ¶
type Matches struct { Text rtti.TextEval Match string Markup map[string]any `json:",omitempty"` // contains filtered or unexported fields }
Determine whether text matches a regular expression. The expressions used are defined by go. https://pkg.go.dev/regexp/syntax https://github.com/google/re2/wiki/Syntax
func (*Matches) GetMarkup ¶
Implements typeinfo.Markup
type Matches_Slice ¶
type Matches_Slice []Matches
Holds a slice of type Matches.
func (*Matches_Slice) Repeats ¶
func (op *Matches_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of Matches.
func (*Matches_Slice) TypeInfo ¶
func (*Matches_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of Matches.
type Pluralize ¶
Pluralize a word. The singular form of a word can have more than one plural form. For example: "person" can be "people" or "persons". If more than one exists, this chooses arbitrarily.
Note, The transformation uses predefined rules and some explicit mappings. The story command [DefinePlural] can add new mappings.
func (*Pluralize) GetMarkup ¶
Implements typeinfo.Markup
type Pluralize_Slice ¶
type Pluralize_Slice []Pluralize
Holds a slice of type Pluralize.
func (*Pluralize_Slice) Repeats ¶
func (op *Pluralize_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of Pluralize.
func (*Pluralize_Slice) TypeInfo ¶
func (*Pluralize_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of Pluralize.
type Singularize ¶
Change a plural word into its singular form. A plural word only has one singular form. For example, given the word "people", return "person". See [pluralize] for more information.
func (*Singularize) GetMarkup ¶
func (op *Singularize) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
func (*Singularize) TypeInfo ¶
func (*Singularize) TypeInfo() typeinfo.T
Implements typeinfo.Instance
type Singularize_Slice ¶
type Singularize_Slice []Singularize
Holds a slice of type Singularize.
func (*Singularize_Slice) Repeats ¶
func (op *Singularize_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of Singularize.
func (*Singularize_Slice) TypeInfo ¶
func (*Singularize_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of Singularize.
type SplitLines ¶ added in v0.24.8
Separate a piece of text into several parts wherever a newline (\n) occurs.
func (*SplitLines) GetMarkup ¶ added in v0.24.8
func (op *SplitLines) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
func (*SplitLines) GetTextList ¶ added in v0.24.8
func (*SplitLines) TypeInfo ¶ added in v0.24.8
func (*SplitLines) TypeInfo() typeinfo.T
Implements typeinfo.Instance
type SplitLines_Slice ¶ added in v0.24.8
type SplitLines_Slice []SplitLines
Holds a slice of type SplitLines.
func (*SplitLines_Slice) Repeats ¶ added in v0.24.8
func (op *SplitLines_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of SplitLines.
func (*SplitLines_Slice) TypeInfo ¶ added in v0.24.8
func (*SplitLines_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of SplitLines.
type SplitText ¶ added in v0.24.8
type SplitText struct { Text rtti.TextEval Separator rtti.TextEval Markup map[string]any `json:",omitempty"` }
Separate a piece of text into several parts.
func (*SplitText) GetMarkup ¶ added in v0.24.8
Implements typeinfo.Markup
func (*SplitText) GetTextList ¶ added in v0.24.8
type SplitText_Slice ¶ added in v0.24.8
type SplitText_Slice []SplitText
Holds a slice of type SplitText.
func (*SplitText_Slice) Repeats ¶ added in v0.24.8
func (op *SplitText_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of SplitText.
func (*SplitText_Slice) TypeInfo ¶ added in v0.24.8
func (*SplitText_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of SplitText.
type SplitWords ¶ added in v0.24.8
Separate a piece of text into several parts wherever a space between words occurs.
func (*SplitWords) GetMarkup ¶ added in v0.24.8
func (op *SplitWords) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
func (*SplitWords) GetTextList ¶ added in v0.24.8
func (*SplitWords) TypeInfo ¶ added in v0.24.8
func (*SplitWords) TypeInfo() typeinfo.T
Implements typeinfo.Instance
type SplitWords_Slice ¶ added in v0.24.8
type SplitWords_Slice []SplitWords
Holds a slice of type SplitWords.
func (*SplitWords_Slice) Repeats ¶ added in v0.24.8
func (op *SplitWords_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of SplitWords.
func (*SplitWords_Slice) TypeInfo ¶ added in v0.24.8
func (*SplitWords_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of SplitWords.
type TextEndsWith ¶
type TextEndsWith struct { Text rtti.TextEval Subtext rtti.TextEval Markup map[string]any `json:",omitempty"` }
Determine whether text ends in a particular way.
func (*TextEndsWith) GetMarkup ¶
func (op *TextEndsWith) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
func (*TextEndsWith) TypeInfo ¶
func (*TextEndsWith) TypeInfo() typeinfo.T
Implements typeinfo.Instance
type TextEndsWith_Slice ¶
type TextEndsWith_Slice []TextEndsWith
Holds a slice of type TextEndsWith.
func (*TextEndsWith_Slice) Repeats ¶
func (op *TextEndsWith_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of TextEndsWith.
func (*TextEndsWith_Slice) TypeInfo ¶
func (*TextEndsWith_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of TextEndsWith.
type TextLen ¶
Count the number of characters in some text.
func (*TextLen) GetMarkup ¶
Implements typeinfo.Markup
type TextLen_Slice ¶
type TextLen_Slice []TextLen
Holds a slice of type TextLen.
func (*TextLen_Slice) Repeats ¶
func (op *TextLen_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of TextLen.
func (*TextLen_Slice) TypeInfo ¶
func (*TextLen_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of TextLen.
type TextStartsWith ¶
type TextStartsWith struct { Text rtti.TextEval Subtext rtti.TextEval Markup map[string]any `json:",omitempty"` }
Determine whether text starts in a particular way.
func (*TextStartsWith) GetMarkup ¶
func (op *TextStartsWith) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
func (*TextStartsWith) TypeInfo ¶
func (*TextStartsWith) TypeInfo() typeinfo.T
Implements typeinfo.Instance
type TextStartsWith_Slice ¶
type TextStartsWith_Slice []TextStartsWith
Holds a slice of type TextStartsWith.
func (*TextStartsWith_Slice) Repeats ¶
func (op *TextStartsWith_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of TextStartsWith.
func (*TextStartsWith_Slice) TypeInfo ¶
func (*TextStartsWith_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of TextStartsWith.