func GenerateCaptionCandidates(captionPath string, exts []string) []string {
	var candidates []string

	basename := strings.TrimSuffix(captionPath, filepath.Ext(captionPath)) // caption filename without the extension

	// a caption file can be something like scene_filename.srt or scene_filename.en.srt
	// if a language code is present and valid remove it from the basename
	languageExt := filepath.Ext(basename)
	if len(languageExt) > 2 && IsValidLanguage(languageExt[1:]) {
		basename = strings.TrimSuffix(basename, languageExt)
	}

	for _, ext := range exts {
		candidates = append(candidates, basename+"."+ext)
	}

	return candidates
}
// GenerateCaptionCandidates generates a list of filenames with exts as extensions
// that can associated with the caption
GenerateCaptionCandidates generates a list of filenames with exts as extensions
that can associated with the caption
// GenerateCaptionCandidates generates a list of filenames with exts as extensions // that can associated with the caption
func GenerateCaptionCandidates(captionPath string, exts []string) []string {
	var candidates []string
	basename := strings.TrimSuffix(captionPath, filepath.Ext(captionPath)) 
	languageExt := filepath.Ext(basename)
	if len(languageExt) > 2 && IsValidLanguage(languageExt[1:]) {
		basename = strings.TrimSuffix(basename, languageExt)
	}
	for _, ext := range exts {
		candidates = append(candidates, basename+"."+ext)
	}
	return candidates
}
func GenerateCaptionCandidates ( captionPath string , exts [ ] string ) [ ] string { var candidates [ ] string basename := strings . TrimSuffix ( captionPath , filepath . Ext ( captionPath ) ) languageExt := filepath . Ext ( basename ) if len ( languageExt ) > 2 && IsValidLanguage ( languageExt [ 1 : ] ) { basename = strings . TrimSuffix ( basename , languageExt ) } for _ , ext := range exts { candidates = append ( candidates , basename + " " + ext ) } return candidates }
GenerateCaptionCandidates generates a list of filenames with exts as extensions
that can associated with the caption
GenerateCaptionCandidates generates a list of filenames with exts as extensions that can associated with the caption
// caption filename without the extension // a caption file can be something like scene_filename.srt or scene_filename.en.srt // if a language code is present and valid remove it from the basename