extract

package
v0.0.0-...-553c0ab Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExportItems

func ExportItems(foreignSubs, nativeSubs *subs.Subtitles, outputBase, mediaSourceFile, mediaPrefix string, write ExportedItemWriter) error

ExportItems calls the write function for each foreign subtitle item.

Types

type ExportedItem

type ExportedItem struct {
	Sound       string
	Time        string
	Source      string
	Image       string
	ForeignCurr string
	NativeCurr  string
	ForeignPrev string
	NativePrev  string
	ForeignNext string
	NativeNext  string
}

ExportedItem represents the exported information of a single subtitle item, where Time is the primary field which identifies the item and ForeignCurr is the actual text of the item. The fields NativeCurr, NativePrev and NativeNext will be empty unless a second subtitle file was specified for the export and that second subtitle file is sufficiently aligned with the first.

func ExportItem

func ExportItem(foreignItem *astisub.Item, nativeSubs *subs.Subtitles, subsBase, mediaFile, mediaPrefix string) (*ExportedItem, error)

type ExportedItemWriter

type ExportedItemWriter func(*ExportedItem) error

ExportedItemWriter should write an exported item in whatever format is selected by the user.

type ExtractCards

type ExtractCards struct {
	ForeignSubtitlesFile string
	NativeSubtitlesFile  string
	MediaSourceFile      string
	OutputFieldSeparator string // defaults to "\t"
	OutputFileExtension  string // defaults to ".tsv" for "\t" and ".csv", otherwise
}

ExtractCards specifies the parameters for generating a CSV export of the given foreign subtitles. The fields NativeSubtitles and MediaSource are optional.

func (*ExtractCards) Execute

func (e *ExtractCards) Execute() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL