Documentation
¶
Index ¶
- func CreateAudioFileMap(database DBAdapter) (map[string]generic.AudioFile, *log.Status)
- func DatabaseExists(username string, project string) bool
- func DestroyDatabase(database string)
- func GetDBPath(database string) string
- func InsertAudioFiles(conn DBAdapter, files []generic.InputFile) *log.Status
- func SelectAudioFiles(conn DBAdapter) ([]generic.InputFile, *log.Status)
- func UpdateIdent(conn DBAdapter, ident *Ident, textFiles []generic.InputFile, ...) *log.Status
- type Audio
- type DBAdapter
- func (d *DBAdapter) CheckScriptInserts(records []Script) *log.Status
- func (d *DBAdapter) Close()
- func (d *DBAdapter) CopyDatabase(suffix string) (DBAdapter, *log.Status)
- func (d *DBAdapter) CountIdentRows() (int, *log.Status)
- func (d *DBAdapter) CountScriptMFCCRows() (int, *log.Status)
- func (d *DBAdapter) CountScriptRows() (int, *log.Status)
- func (d *DBAdapter) CountWordMFCCRows() (int, *log.Status)
- func (d *DBAdapter) CountWordRows() (int, *log.Status)
- func (d *DBAdapter) DeleteMFCCs()
- func (d *DBAdapter) DeleteScripts(bookId string, chapterNum int) *log.Status
- func (d *DBAdapter) DeleteWords()
- func (d *DBAdapter) EraseDatabase()
- func (d *DBAdapter) InsertAudioChars(words []Audio) *log.Status
- func (d *DBAdapter) InsertAudioVerses(bookId string, chapter int, filename string, records []Audio) ([]Audio, *log.Status)
- func (d *DBAdapter) InsertAudioWords(words []Audio) ([]Audio, *log.Status)
- func (d *DBAdapter) InsertOutput(outputs []Output) *log.Status
- func (d *DBAdapter) InsertReplaceIdent(id Ident) *log.Status
- func (d *DBAdapter) InsertRequest(req request.Request) *log.Status
- func (d *DBAdapter) InsertScriptMFCCS(mfccs []MFCC) *log.Status
- func (d *DBAdapter) InsertScripts(records []Script) *log.Status
- func (d *DBAdapter) InsertWordMFCCS(mfccs []MFCC) *log.Status
- func (d *DBAdapter) InsertWords(records []Word) *log.Status
- func (d *DBAdapter) SelectBookChapter() ([]Script, *log.Status)
- func (d *DBAdapter) SelectBookChapterFilename() ([]Script, *log.Status)
- func (d *DBAdapter) SelectFACharTimestamps(cutoff float64) ([]generic.AlignChar, *log.Status)
- func (d *DBAdapter) SelectFAScriptTimestamps(bookId string, chapter int) ([]Audio, *log.Status)
- func (d *DBAdapter) SelectFAWordTimestamps() ([]Audio, *log.Status)
- func (d *DBAdapter) SelectIdent() (Ident, *log.Status)
- func (d *DBAdapter) SelectOutputs() ([]Output, *log.Status)
- func (d *DBAdapter) SelectRequest() (request.Request, *log.Status)
- func (d *DBAdapter) SelectScalarInt(sql string) (int, *log.Status)
- func (d *DBAdapter) SelectScriptHeadings() ([]Script, *log.Status)
- func (d *DBAdapter) SelectScriptIds() ([]Script, *log.Status)
- func (d *DBAdapter) SelectScriptLine(lineId int64) (string, *log.Status)
- func (d *DBAdapter) SelectScriptTimestamps(bookId string, chapter int) ([]Timestamp, *log.Status)
- func (d *DBAdapter) SelectScripts() ([]Script, *log.Status)
- func (d *DBAdapter) SelectScriptsByBookChapter(bookId string, chapter int) ([]Script, *log.Status)
- func (d *DBAdapter) SelectScriptsByChapter(bookId string, chapterNum int) ([]Script, *log.Status)
- func (d *DBAdapter) SelectUromanLine(lineId int64) (string, *log.Status)
- func (d *DBAdapter) SelectWordTimestamps(bookId string, chapter int) ([]Timestamp, *log.Status)
- func (d *DBAdapter) SelectWords() ([]Word, *log.Status)
- func (d *DBAdapter) SelectWordsByBookChapter(bookId string, chapter int) ([]Word, *log.Status)
- func (d *DBAdapter) UpdateASRLanguage(isoCode string) *log.Status
- func (d *DBAdapter) UpdateEraseScriptText() *log.Status
- func (d *DBAdapter) UpdateIdent(ident Ident) *log.Status
- func (d *DBAdapter) UpdateScriptFATimestamps(audio []Audio) *log.Status
- func (d *DBAdapter) UpdateScriptText(audio []Audio) (int, *log.Status)
- func (d *DBAdapter) UpdateScriptTimestamps(scripts []Timestamp) *log.Status
- func (d *DBAdapter) UpdateUromanText(scripts []Script) (int, *log.Status)
- func (d *DBAdapter) UpdateWordEncodings(words []Word) *log.Status
- func (d *DBAdapter) UpdateWordFATimestamps(audio []Audio) *log.Status
- func (d *DBAdapter) UpdateWordTimestamps(words []Timestamp) *log.Status
- type Ident
- type MFCC
- type Output
- type Script
- type Timestamp
- type Word
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateAudioFileMap ¶ added in v1.2.0
func DatabaseExists ¶
func DestroyDatabase ¶
func DestroyDatabase(database string)
DestroyDatabase should only be used by testing
func InsertAudioFiles ¶ added in v1.2.0
func SelectAudioFiles ¶ added in v1.2.0
Types ¶
type Audio ¶
type Audio struct {
WordId int64 `json:"word_id,omitempty"` // Used only for Word table
ScriptId int64 `json:"script_id"`
BookId string `json:"book_id"`
ChapterNum int `json:"chapter_num"`
ChapterEnd int `json:"chapter_end"`
VerseStr string `json:"verse_str"`
VerseEnd string `json:"verse_end"`
VerseSeq int `json:"verse_seq"`
WordSeq int `json:"word_seq"` // Used by Words, not Verses
BeginTS float64 `json:"begin_ts"`
EndTS float64 `json:"end_ts"`
FAScore float64 `json:"fa_score"`
Uroman string `json:"uroman"` // Is this useful?
Text string `json:"text"`
Chars []generic.Char `json:"-"`
AudioFile string `json:"audio_file"`
ScriptBeginTS float64 `json:"script_begin_ts"` // Contains script TS when it is a word record
ScriptEndTS float64 `json:"script_end_ts"` // Contains script TS when it is a word record
ScriptFAScore float64 `json:"script_fa_score"` // Contains script score when it is a word record
PlayBeginTS float64 `json:"-"` // Verse audio for listening, see scripts.play_begin_ts
PlayEndTS float64 `json:"-"`
AudioChapterWav string `json:"-"` // Transient
AudioVerseWav string `json:"-"` // Transient
}
type DBAdapter ¶
type DBAdapter struct {
Ctx context.Context
User string
Project string
Database string
DatabasePath string
DB *sql.DB
}
func NewDBAdapter ¶
NewDBAdapter should be used for :memory: and when the database parameter is a path.
func NewerDBAdapter ¶
func NewerDBAdapter(ctx context.Context, isNew bool, user string, project string) (DBAdapter, *log.Status)
NewerDBAdapter should be used for production
func (*DBAdapter) CheckScriptInserts ¶
func (*DBAdapter) CopyDatabase ¶
CopyDatabase copies a database, closes it and return a connection to the copy
func (*DBAdapter) CountScriptMFCCRows ¶
func (*DBAdapter) DeleteMFCCs ¶
func (d *DBAdapter) DeleteMFCCs()
func (*DBAdapter) DeleteScripts ¶
func (*DBAdapter) DeleteWords ¶
func (d *DBAdapter) DeleteWords()
func (*DBAdapter) EraseDatabase ¶
func (d *DBAdapter) EraseDatabase()
func (*DBAdapter) InsertAudioChars ¶
func (*DBAdapter) InsertAudioVerses ¶
func (*DBAdapter) InsertAudioWords ¶
func (*DBAdapter) InsertOutput ¶ added in v1.2.0
func (*DBAdapter) InsertRequest ¶ added in v1.2.0
func (*DBAdapter) InsertScriptMFCCS ¶
func (*DBAdapter) SelectBookChapter ¶
func (*DBAdapter) SelectBookChapterFilename ¶
func (*DBAdapter) SelectFACharTimestamps ¶
func (*DBAdapter) SelectFAScriptTimestamps ¶
func (*DBAdapter) SelectFAWordTimestamps ¶
func (*DBAdapter) SelectOutputs ¶ added in v1.2.0
func (*DBAdapter) SelectRequest ¶ added in v1.2.0
func (*DBAdapter) SelectScalarInt ¶
func (*DBAdapter) SelectScriptHeadings ¶
func (*DBAdapter) SelectScriptIds ¶
SelectScriptIds is used by api_dbp_timestamps
func (*DBAdapter) SelectScriptLine ¶
SelectScriptLine selects by script_id and returns one line of script text
func (*DBAdapter) SelectScriptTimestamps ¶
func (*DBAdapter) SelectScripts ¶
SelectScripts is used by WordParser
func (*DBAdapter) SelectScriptsByBookChapter ¶
SelectScriptsByBookChapter ...
func (*DBAdapter) SelectScriptsByChapter ¶
SelectScriptsByChapter is used by Compare
func (*DBAdapter) SelectUromanLine ¶
SelectUromanLine selects by script_id and returns one line of script text
func (*DBAdapter) SelectWordTimestamps ¶
func (*DBAdapter) SelectWords ¶
SelectWords is used by encode.FastText
func (*DBAdapter) SelectWordsByBookChapter ¶
SelectWordsByBookChapter is used by Aeneas and mms_fa
func (*DBAdapter) UpdateASRLanguage ¶
func (*DBAdapter) UpdateEraseScriptText ¶
func (*DBAdapter) UpdateScriptFATimestamps ¶
func (*DBAdapter) UpdateScriptText ¶
func (*DBAdapter) UpdateScriptTimestamps ¶
func (*DBAdapter) UpdateUromanText ¶
func (*DBAdapter) UpdateWordEncodings ¶
func (*DBAdapter) UpdateWordFATimestamps ¶
type Script ¶
type Script struct {
ScriptId int
DatasetId int
BookId string
ChapterNum int
ChapterEnd int
VerseStr string
VerseEnd string
VerseNum int
AudioFile string
ScriptNum string
UsfmStyle string
Person string
Actor string
ScriptText string
URoman string
ScriptTexts []string
ScriptBeginTS float64
ScriptEndTS float64
}