Documentation
¶
Overview ¶
Package customize defines SpeechKit's public Words/Replacements contract.
Index ¶
- Constants
- func NormalizeLanguage(language string) string
- func StableID(prefix string, parts ...string) string
- func ValidatePack(pack Pack) error
- func ValidateReplacement(replacement Replacement) error
- func ValidateWord(word Word) error
- type Context
- type Kind
- type Lexicon
- type ListOptions
- type Match
- type MatchType
- type Mode
- type Pack
- type ReplaceOptions
- type Replacement
- type ReplacementOutput
- type Ruleset
- type ScopeKind
- type ScopeRef
- type Stage
- type Word
Constants ¶
View Source
const PackSchemaVersion = "speechkit.customization.pack.v1"
Variables ¶
This section is empty.
Functions ¶
func NormalizeLanguage ¶
func ValidatePack ¶
func ValidateReplacement ¶
func ValidateReplacement(replacement Replacement) error
func ValidateWord ¶
Types ¶
type Context ¶
type Context struct {
Mode Mode `json:"mode,omitempty"`
Language string `json:"language,omitempty"`
Stage Stage `json:"stage,omitempty"`
Tags []string `json:"tags,omitempty"`
Persona string `json:"persona,omitempty"`
ActiveTemplateIDs []string `json:"active_template_ids,omitempty"`
ScopeOrder []ScopeRef `json:"scope_order,omitempty"`
}
type Lexicon ¶
type Lexicon struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Language string `json:"language,omitempty"`
WordIDs []string `json:"word_ids,omitempty"`
Tags []string `json:"tags,omitempty"`
Source string `json:"source,omitempty"`
Scope *ScopeRef `json:"scope,omitempty"`
Enabled bool `json:"enabled"`
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
}
type ListOptions ¶
type Pack ¶
type Pack struct {
SchemaVersion string `json:"schema_version"`
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Words []Word `json:"words,omitempty"`
Replacements []Replacement `json:"replacements,omitempty"`
Lexicons []Lexicon `json:"lexicons,omitempty"`
Rulesets []Ruleset `json:"rulesets,omitempty"`
Attachments json.RawMessage `json:"attachments,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
}
type ReplaceOptions ¶
type Replacement ¶
type Replacement struct {
ID string `json:"id"`
Kind Kind `json:"kind"`
Match Match `json:"match"`
Output ReplacementOutput `json:"output"`
Language string `json:"language,omitempty"`
Modes []Mode `json:"modes,omitempty"`
Stage Stage `json:"stage"`
Priority int `json:"priority,omitempty"`
Tags []string `json:"tags,omitempty"`
Source string `json:"source,omitempty"`
Scope *ScopeRef `json:"scope,omitempty"`
Enabled bool `json:"enabled"`
UsageCount int `json:"usage_count,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
}
func WithDefaultsReplacement ¶
func WithDefaultsReplacement(replacement Replacement) Replacement
type ReplacementOutput ¶
type Ruleset ¶
type Ruleset struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Language string `json:"language,omitempty"`
ReplacementIDs []string `json:"replacement_ids,omitempty"`
Tags []string `json:"tags,omitempty"`
Source string `json:"source,omitempty"`
Scope *ScopeRef `json:"scope,omitempty"`
Enabled bool `json:"enabled"`
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
}
type ScopeRef ¶
func DefaultDeviceScopeOrder ¶
func DefaultDeviceScopeOrder() []ScopeRef
func DefaultServerScopeOrder ¶
func DefaultServerScopeOrder() []ScopeRef
func NormalizeScopeRef ¶
type Word ¶
type Word struct {
ID string `json:"id"`
Term string `json:"term"`
SoundsLike []string `json:"sounds_like,omitempty"`
Language string `json:"language,omitempty"`
Weight float64 `json:"weight,omitempty"`
Tags []string `json:"tags,omitempty"`
Scope *ScopeRef `json:"scope,omitempty"`
Source string `json:"source,omitempty"`
Enabled bool `json:"enabled"`
UsageCount int `json:"usage_count,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
}
func WithDefaultsWord ¶
Click to show internal directories.
Click to hide internal directories.