Documentation
¶
Index ¶
- Variables
- func DatabaseExists(username string, project string) bool
- func DestroyDatabase(database string)
- func GetDBPath(database string) string
- func RequestedBooks(testament request.Testament) []string
- func Testament(bookId string) string
- func USFMBookId(ctx context.Context, bookName string) string
- 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) InsertReplaceIdent(id Ident) *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() ([]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) 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 Script
- type Timestamp
- type Word
Constants ¶
This section is empty.
Variables ¶
View Source
var BookChapterMap = map[string]int{
`GEN`: 50,
`EXO`: 40,
`LEV`: 27,
`NUM`: 36,
`DEU`: 34,
`JOS`: 24,
`JDG`: 21,
`RUT`: 4,
`1SA`: 31,
`2SA`: 24,
`1KI`: 22,
`2KI`: 25,
`1CH`: 29,
`2CH`: 36,
`EZR`: 10,
`NEH`: 13,
`EST`: 10,
`JOB`: 42,
`PSA`: 150,
`PRO`: 31,
`ECC`: 12,
`SNG`: 8,
`ISA`: 66,
`JER`: 52,
`LAM`: 5,
`EZK`: 48,
`DAN`: 12,
`HOS`: 14,
`JOL`: 3,
`AMO`: 9,
`OBA`: 1,
`JON`: 4,
`MIC`: 7,
`NAM`: 3,
`HAB`: 3,
`ZEP`: 3,
`HAG`: 2,
`ZEC`: 14,
`MAL`: 4,
`COV`: 4,
`MAT`: 28,
`MRK`: 16,
`LUK`: 24,
`JHN`: 21,
`ACT`: 28,
`ROM`: 16,
`1CO`: 16,
`2CO`: 13,
`GAL`: 6,
`EPH`: 6,
`PHP`: 4,
`COL`: 4,
`1TH`: 5,
`2TH`: 3,
`1TI`: 6,
`2TI`: 4,
`TIT`: 3,
`PHM`: 1,
`HEB`: 13,
`JAS`: 5,
`1PE`: 5,
`2PE`: 3,
`1JN`: 5,
`2JN`: 1,
`3JN`: 1,
`JUD`: 1,
`REV`: 22,
}
View Source
var BookNT = []string{`MAT`, `MRK`, `LUK`, `JHN`, `ACT`, `ROM`, `1CO`, `2CO`, `GAL`, `EPH`, `PHP`, `COL`,
`1TH`, `2TH`, `1TI`, `2TI`, `TIT`, `PHM`, `HEB`, `JAS`, `1PE`, `2PE`, `1JN`, `2JN`, `3JN`, `JUD`, `REV`}
View Source
var BookOT = []string{`GEN`, `EXO`, `LEV`, `NUM`, `DEU`, `JOS`, `JDG`, `RUT`, `1SA`, `2SA`, `1KI`, `2KI`,
`1CH`, `2CH`, `EZR`, `NEH`, `EST`, `JOB`, `PSA`, `PRO`, `ECC`, `SNG`, `ISA`, `JER`, `LAM`, `EZK`, `DAN`,
`HOS`, `JOL`, `AMO`, `OBA`, `JON`, `MIC`, `NAM`, `HAB`, `ZEP`, `HAG`, `ZEC`, `MAL`, `COV`}
View Source
var BookSeqMap = map[string]int{}/* 117 elements not displayed */
Functions ¶
func DatabaseExists ¶
func DestroyDatabase ¶
func DestroyDatabase(database string)
DestroyDatabase should only be used by testing
func RequestedBooks ¶
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
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: database and test.
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) InsertScriptMFCCS ¶
func (*DBAdapter) SelectBookChapter ¶
func (*DBAdapter) SelectBookChapterFilename ¶
func (*DBAdapter) SelectFACharTimestamps ¶
func (*DBAdapter) SelectFAScriptTimestamps ¶
func (*DBAdapter) SelectFAWordTimestamps ¶
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
}
Click to show internal directories.
Click to hide internal directories.