aliyun

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: May 24, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const API_VERSION string = "2018-08-17"
View Source
const DOMAIN string = "filetrans.cn-shanghai.aliyuncs.com"
View Source
const ENDPOINT_NAME string = "cn-shanghai"
View Source
const GET_REQUEST_ACTION string = "GetTaskResult"
View Source
const KEY_APP_KEY string = "appkey"

请求参数key

View Source
const KEY_ENABLE_DISFLUENCY = "enable_disfluency"
View Source
const KEY_ENABLE_UNIFY_POST = "enable_unify_post"
View Source
const KEY_ENABLE_WORDS string = "enable_words"
View Source
const KEY_FILE_LINK string = "file_link"
View Source
const KEY_MAX_SINGLE_SEGMENT_TIME = "max_single_segment_time"
View Source
const KEY_RESULT string = "Result"
View Source
const KEY_STATUS_TEXT string = "StatusText"
View Source
const KEY_TASK string = "Task"

响应参数key

View Source
const KEY_TASK_ID string = "TaskId"
View Source
const KEY_VERSION string = "version"
View Source
const POST_REQUEST_ACTION string = "SubmitTask"
View Source
const PRODUCT string = "nls-filetrans"
View Source
const REGION_ID string = "cn-shanghai"

地域ID,常量内容,请勿改变

View Source
const STATUS_QUEUEING string = "QUEUEING"
View Source
const STATUS_RUNNING string = "RUNNING"
View Source
const STATUS_SUCCESS string = "SUCCESS"

状态值

Variables

View Source
var (
	WellKnownNumber = map[string]int{
		"zero":      0,
		"one":       1,
		"two":       2,
		"three":     3,
		"four":      4,
		"five":      5,
		"six":       6,
		"seven":     7,
		"eight":     8,
		"nine":      9,
		"ten":       10,
		"eleven":    11,
		"twelve":    12,
		"thirteen":  13,
		"fourteen":  14,
		"fifteen":   15,
		"sixteen":   16,
		"seventeen": 17,
		"eighteen":  18,
		"nineteen":  19,
		"twenty":    20,
		"thirty":    30,
		"forty":     40,
		"fifty":     50,
		"sixty":     60,
		"seventy":   70,
		"eighty":    80,
		"ninety":    90,
		"thousand":  1000,
		"hundred":   100,
		"million":   1000000,
		"minus":     -99,
	}

	WellKnowUnit = map[string]string{
		"b": "bytes",
	}
)

Functions

func NewSpeech

func NewSpeech(accessKeyId, accessKeySecret, appKey string) text.ISpeech

Types

type Response

type Response struct {
	TaskId      string  `json:"TaskId"`
	RequestId   string  `json:"RequestId"`
	StatusText  string  `json:"StatusText"`
	BizDuration int64   `json:"BizDuration"`
	SolveTime   int64   `json:"SolveTime"`
	StatusCode  int32   `json:"StatusCode"`
	Result      *Result `json:"Result"`
}

type Result

type Result struct {
	Sentences []*SentencesResult `json:"Sentences"`
	Words     []*WordResult      `json:"Words"`
}

type SentencesResult

type SentencesResult struct {
	EndTime         int64  `json:"EndTime"`
	SilenceDuration int    `json:"SilenceDuration"`
	BeginTime       int64  `json:"BeginTime"`
	Text            string `json:"Text"`
	ChannelId       int    `json:"ChannelId"`
	SpeechRate      int    `json:"SpeechRate"`
	EmotionValue    int    `json:"EmotionValue"`
}

type Speech

type Speech struct {
	// contains filtered or unexported fields
}

func (*Speech) BreakSentence added in v1.1.1

func (s *Speech) BreakSentence(channelId int, rsp *Response) (ret []*srt.Srt, err error)

func (*Speech) Equal added in v1.1.2

func (s *Speech) Equal(sw, w string) bool

sw 句子中的词, w单词

func (*Speech) Recognize

func (s *Speech) Recognize(ctx context.Context, fileUri string) (ret []*srt.Srt, err error)

type WordResult added in v1.1.1

type WordResult struct {
	BeginTime int64  `json:"BeginTime"`
	EndTime   int64  `json:"EndTime"`
	ChannelId int    `json:"ChannelId"`
	Word      string `json:"Word"`
}

Jump to

Keyboard shortcuts

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