Organize generic and Seriatim modules by domain
This commit is contained in:
28
internal/modules/seriatim/input/transcript/metadata.go
Normal file
28
internal/modules/seriatim/input/transcript/metadata.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package transcript
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"gitea.maximumdirect.net/eric/notarius/internal/core/source"
|
||||
)
|
||||
|
||||
const (
|
||||
MetadataSpeaker = "speaker"
|
||||
MetadataStart = "start"
|
||||
MetadataEnd = "end"
|
||||
)
|
||||
|
||||
func Speaker(unit source.SourceUnit) (string, bool) {
|
||||
value, ok := unit.Metadata[MetadataSpeaker].(string)
|
||||
return value, ok
|
||||
}
|
||||
|
||||
func Start(unit source.SourceUnit) (json.Number, bool) {
|
||||
value, ok := unit.Metadata[MetadataStart].(json.Number)
|
||||
return value, ok
|
||||
}
|
||||
|
||||
func End(unit source.SourceUnit) (json.Number, bool) {
|
||||
value, ok := unit.Metadata[MetadataEnd].(json.Number)
|
||||
return value, ok
|
||||
}
|
||||
Reference in New Issue
Block a user