Documentation
¶
Overview ¶
Package rwc provides a pseudo-Russian word constructor.
Index ¶
- Variables
- func Word(length int) string
- func WordMask(mask string) string
- type Constructor
- func (c *Constructor) LearnFrom(r io.Reader) error
- func (c *Constructor) LoadFrom(r io.Reader) error
- func (c *Constructor) LoadFromRWC(filename string) error
- func (c *Constructor) Source() []byte
- func (c *Constructor) Word(n int) string
- func (c *Constructor) WordMask(mask string) string
- func (c *Constructor) WriteTo(w io.Writer) (int64, error)
Constants ¶
This section is empty.
Variables ¶
var DefaultConstructor = Constructor{ // contains filtered or unexported fields }
DefaultConstructor is the default word constructor.
Functions ¶
Types ¶
type Constructor ¶
type Constructor struct {
// contains filtered or unexported fields
}
Constructor is a pseudo-Russian word constructor.
func (*Constructor) LearnFrom ¶
func (c *Constructor) LearnFrom(r io.Reader) error
LearnFrom learns n-grams from an UTF-8 text it reads from r. One can call LearnFrom multiple times with different readers.
func (*Constructor) LoadFrom ¶
func (c *Constructor) LoadFrom(r io.Reader) error
LoadFrom loads binary representation of Constructor from r.
func (*Constructor) LoadFromRWC ¶
func (c *Constructor) LoadFromRWC(filename string) error
LoadFromRWC loads binary representation of Constructor from an .RWC file.
func (*Constructor) Source ¶
func (c *Constructor) Source() []byte
Source returns the Go code for initializing Constructor, like the code you can see in the autogenerated.go
func (*Constructor) Word ¶
func (c *Constructor) Word(n int) string
Word returns a pseudo-Russian word of the specified length.
func (*Constructor) WordMask ¶
func (c *Constructor) WordMask(mask string) string
WordMask returns a pseudo-Russian word matching the mask. The mask may contain lowercase letters from 'а' to 'я' (excluding 'ё') and the following special symbols: V - for a vowel; C - for a consonant; . (dot) - for any letter.