Documentation
¶
Index ¶
- func IsDefaultStyle(item *astisub.Item) bool
- func Subs2DubsFromView(dv *DialogueView, outputFile, FieldSep string) error
- type DialogueView
- type Subtitles
- func (subs *Subtitles) FilterToDefaultStyle()
- func (s *Subtitles) NewDialogueView() *DialogueView
- func (subs *Subtitles) Subs2Dubs(outputFile, FieldSep string) (err error)
- func (subs *Subtitles) Translate(item *astisub.Item) *astisub.Item
- func (subs *Subtitles) TrimCC2Dubs()
- func (subs *Subtitles) Write(filename string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsDefaultStyle ¶
IsDefaultStyle checks whether an item's style matches the "Default" prefix. Items without a style are treated as Default (common in SRT files).
func Subs2DubsFromView ¶
func Subs2DubsFromView(dv *DialogueView, outputFile, FieldSep string) error
Subs2DubsFromView updates dialogue items through the view with STT transcriptions loaded from the TSV. This ensures mutations go through to the canonical structure.
Types ¶
type DialogueView ¶
type DialogueView struct {
// contains filtered or unexported fields
}
DialogueView provides indexed access to dialogue-only items within a full subtitle structure. Items accessed through the view are pointers into the canonical Subtitles, so mutations (e.g. STT text updates) propagate automatically without any sync step.
func (*DialogueView) Item ¶
func (dv *DialogueView) Item(i int) *astisub.Item
Item returns a pointer to the canonical subtitle item at the given dialogue index. Mutations go through to the underlying Subtitles.
func (*DialogueView) Len ¶
func (dv *DialogueView) Len() int
Len returns the number of dialogue items in the view.
func (*DialogueView) RawIndex ¶
func (dv *DialogueView) RawIndex(i int) int
RawIndex returns the index in the full subtitle structure for a dialogue index.
func (*DialogueView) Subs ¶
func (dv *DialogueView) Subs() *Subtitles
Subs returns the underlying canonical Subtitles structure.
type Subtitles ¶
func DeepCopy ¶
DeepCopy creates a deep copy of the Subtitles structure. Uses jinzhu/copier for reliable deep copying that automatically handles new fields added to astisub types.
func (*Subtitles) FilterToDefaultStyle ¶
func (subs *Subtitles) FilterToDefaultStyle()
FilterToDefaultStyle removes all items that don't have a style matching "Default" prefix. Deprecated: prefer NewDialogueView() which provides a non-destructive view. Kept for use in bulk item counting where a temporary copy is used.
func (*Subtitles) NewDialogueView ¶
func (s *Subtitles) NewDialogueView() *DialogueView
NewDialogueView builds a view containing only Default-style items.
func (*Subtitles) Translate ¶
Translate generates a new subtitle from all subtitles which overlap with the given item. FIXME
func (*Subtitles) TrimCC2Dubs ¶
func (subs *Subtitles) TrimCC2Dubs()