Documentation
¶
Index ¶
- func Transform(message string, db database.Database, skipCommon bool) string
- type MessageMetadata
- type ReversibleStringBuilder
- func (rsb *ReversibleStringBuilder) Flush() error
- func (rsb *ReversibleStringBuilder) Grow(n int)
- func (rsb *ReversibleStringBuilder) Init()
- func (rsb *ReversibleStringBuilder) Len() int
- func (rsb *ReversibleStringBuilder) Reverse(n int)
- func (rsb *ReversibleStringBuilder) String() string
- func (rsb *ReversibleStringBuilder) WriteString(s string) (int, error)
- type WordMetadata
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MessageMetadata ¶
type MessageMetadata struct { Words []string Metadata []*WordMetadata // contains filtered or unexported fields }
MessageMetadata contains a list of words and their associated metadata.
func (*MessageMetadata) New ¶
func (m *MessageMetadata) New(message string)
New initializes message metadata struct from a string.
func (MessageMetadata) String ¶
func (m MessageMetadata) String() string
type ReversibleStringBuilder ¶
type ReversibleStringBuilder struct {
// contains filtered or unexported fields
}
ReversibleStringBuilder is a string builder that allows the user to reverse a certain number of write instructions issued to it.
func (*ReversibleStringBuilder) Flush ¶
func (rsb *ReversibleStringBuilder) Flush() error
Flush writes everything in the buffer to the string builder. All potentially reversible operations will be saved to the string builer and can no longer be reversed.
func (*ReversibleStringBuilder) Grow ¶
func (rsb *ReversibleStringBuilder) Grow(n int)
Grow tells the internal string builder to grow by n characters.
func (*ReversibleStringBuilder) Init ¶
func (rsb *ReversibleStringBuilder) Init()
Init initializes internal fields within the string builder.
func (*ReversibleStringBuilder) Len ¶
func (rsb *ReversibleStringBuilder) Len() int
Len returns the length of the string in the reversible buffer plus the length of the string in the builder.
func (*ReversibleStringBuilder) Reverse ¶
func (rsb *ReversibleStringBuilder) Reverse(n int)
Reverse undos the last n WriteString operations. It can undo as many WriteString calls since the last call to Flush(). Passing clears the buffers.
func (*ReversibleStringBuilder) String ¶
func (rsb *ReversibleStringBuilder) String() string
String flushes the buffer and returns the stored string.
func (*ReversibleStringBuilder) WriteString ¶
func (rsb *ReversibleStringBuilder) WriteString(s string) (int, error)
WriteString writes to the reversible buffer without writing to the string builder. Use Flush() commit changes to the string builder.
type WordMetadata ¶
WordMetadata is individual word metadata information.