Documentation
¶
Overview ¶
Package mapper is used to map between different phonetic symbol sets, such as NST-SAMPA to Wikispeech-SAMPA, IPA to SAMPA, and so on. (Documentation on symbol sets can be found in the parent package 'symbolset'.)
By using each symbol set's IPA definition, it is possible to map between symbol sets that share the same list of IPA symbols (or if the left hand symbol is a subset of the right hand symbol set).
Index ¶
- type Mapper
- type Service
- func (s Service) Clear()
- func (s Service) DeleteMapper(fromName string, toName string) error
- func (s Service) DeleteSymbolSet(ssName string) error
- func (s Service) GetMapTable(fromName string, toName string) (Mapper, error)
- func (s Service) Load(symbolSetFile string) error
- func (s Service) Map(fromName string, toName string, trans string) (string, error)
- func (s Service) MapperNames() []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mapper ¶
Mapper is a struct for package private usage. To create a new instance of Mapper, use LoadMapper.
func LoadMapper ¶
LoadMapper loads a symbol set mapper from two SymbolSet instances
func LoadMapperFromFile ¶
func LoadMapperFromFile(fromName string, toName string, fName1 string, fName2 string) (Mapper, error)
LoadMapperFromFile loads two SymbolSet instances from files.
func (Mapper) MapSymbolString ¶
MapSymbolString maps one input transcription symbol into the new symbol set.
func (Mapper) MapTranscription ¶
MapTranscription maps one input transcription string into the new symbol set.
type Service ¶
Service is a container for maintaining 'cached' mappers and their symbol sets. Please note that currently, MapperService need to be used as mutex, see lexserver/mapper.go
func (Service) Clear ¶
func (s Service) Clear()
Clear is used to clear the cache (all loaded symbol sets and mappers)
func (Service) DeleteMapper ¶
DeleteMapper is used to delete a mapper the cache.
func (Service) DeleteSymbolSet ¶
DeleteSymbolSet is used to delete a named symbol set from the cache. Deletes the named symbol set, and all mappers using this symbol set.
func (Service) GetMapTable ¶
GetMapTable is used by the server to show/get a mapping table between two symbol sets
func (Service) Map ¶
Map is used by the server to map a transcription from one symbol set to another
func (Service) MapperNames ¶
MapperNames lists the names for all loaded mappers