Documentation
¶
Index ¶
- Variables
- func AppendAside(s, clause string) string
- func AppendClause(s, clause string) string
- func AppendIndependentClause(s, clause string) string
- func AppendRelated(s, clause string) string
- func AppendSentence(base, s string) string
- func CardinalNoun(n int) string
- func CardinalSuffix(n int) string
- func CardinalWithUnit(n int, singular string, plural string) string
- func FinishSentence(s string) string
- func FormatSentence(s string) string
- func JoinList(strs []string) string
- func JoinListOr(strs []string) string
- func JoinSentenceParts(parts ...string) string
- func JoinSentences(ss ...string) string
- func LowerFirst(s string) string
- func LowerIfFirstWordIn(s string, words ...string) string
- func MaybeAn(s string) string
- func MaybePluralise(s string, quantity int) string
- func MaybePossessiveSuffix(s string) string
- func MultiplicativeAdverb(n int) string
- func OrdinalNoun(n int) string
- func PrefixLines(s string, prefix string) string
- func RemoveAllWhitespace(s string) string
- func RemoveRedundantWhitespace(s string) string
- func ReplaceFirstNumberWithCardinalNoun(s string) string
- func SmallCardinalNoun(n int) string
- func StartsWithNumeral(s string) bool
- func StripNewlines(s string) string
- func StripTerminator(s string) string
- func StripWasIs(st string) string
- func UpperFirst(s string) string
- type Para
- func (p *Para) AddCompleteSentence(ss ...string)
- func (p *Para) AppendAsAside(clause string)
- func (p *Para) AppendClause(ss ...string)
- func (p *Para) AppendList(ss ...string)
- func (p *Para) Continue(ss ...string)
- func (p *Para) CurrentSentenceLength() int
- func (p *Para) CurrentSentenceWords() int
- func (p *Para) DropSentence()
- func (p *Para) FinishSentence()
- func (p *Para) FinishSentenceWithTerminator(t string)
- func (p *Para) Length() int
- func (p *Para) NewSentence(ss ...string)
- func (p *Para) ReplaceSentence(s string)
- func (p *Para) Text() string
Constants ¶
This section is empty.
Variables ¶
var CommonSentenceStarts = []string{"He", "She", "They", "His", "Her", "Their", "The", "It"}
Functions ¶
func AppendAside ¶
func AppendClause ¶
func AppendIndependentClause ¶
func AppendRelated ¶
func AppendSentence ¶
func CardinalNoun ¶
func CardinalSuffix ¶
func FinishSentence ¶
func FormatSentence ¶
func JoinListOr ¶
func JoinSentenceParts ¶
func JoinSentences ¶
func LowerFirst ¶
func LowerIfFirstWordIn ¶
func MaybePluralise ¶
func MaybePossessiveSuffix ¶
func MultiplicativeAdverb ¶
func OrdinalNoun ¶
func PrefixLines ¶
func RemoveAllWhitespace ¶
func SmallCardinalNoun ¶
func StartsWithNumeral ¶
func StripNewlines ¶
func StripTerminator ¶
func StripWasIs ¶
func UpperFirst ¶
Types ¶
type Para ¶
type Para struct {
// contains filtered or unexported fields
}
func (*Para) AddCompleteSentence ¶
AddCompleteSentence combines the supplied strings into a formatted sentence and adds it to the para. Any open sentence is finished first. The para is left at the start of a new sentence.
func (*Para) AppendAsAside ¶
AppendAsAside appends an aside to the current sentence, preceding it with a comma if necessary and appending a comma after the clause.
func (*Para) AppendClause ¶
AppendClause appends a clause to the current sentence, preceding it with a comma if necessary.
func (*Para) AppendList ¶
func (*Para) CurrentSentenceLength ¶
func (*Para) CurrentSentenceWords ¶
func (*Para) FinishSentence ¶
func (p *Para) FinishSentence()
FinishSentence completes the current sentence, terminating it with a full stop and leaves the paragraph ready for the next one.
func (*Para) FinishSentenceWithTerminator ¶
FinishSentence completes the current sentence, terminating it with t and leaves the paragraph ready for the next one.
func (*Para) NewSentence ¶
NewSentence begins a new sentence by finishing any existing sentence and combining the strings into text which becomes the current sentence. No punctuation or formatting is performed on the new sentence.
func (*Para) ReplaceSentence ¶
ReplaceSentence replaces the current sentence with s