public class AmazonTranscribe extends AbstractParser implements Initializable
Silently becomes unavailable when client keys are unavailable. N.B. it is not necessary to create the bucket before hand. This implementation will automatically create the bucket if one does not already exist, per the name defined above.
Modifier and Type | Field and Description |
---|---|
protected static Set<MediaType> |
SUPPORTED_TYPES |
Constructor and Description |
---|
AmazonTranscribe() |
Modifier and Type | Method and Description |
---|---|
void |
checkInitialization(InitializableProblemHandler problemHandler) |
Set<MediaType> |
getSupportedTypes(ParseContext context)
Returns the set of media types supported by this parser when used
with the given parse context.
|
void |
initialize(Map<String,Param> params) |
boolean |
isAvailable() |
void |
parse(InputStream stream,
ContentHandler handler,
Metadata metadata,
ParseContext context)
Starts AWS Transcribe Job with language specification.
|
void |
setBucket(String bucket)
Sets the client secret for the transcriber API.
|
void |
setClientId(String id)
Sets the client Id for the transcriber API.
|
void |
setClientSecret(String secret)
Sets the client secret for the transcriber API.
|
void |
setRegion(String region) |
parse
public Set<MediaType> getSupportedTypes(ParseContext context)
Parser
getSupportedTypes
in interface Parser
context
- parse contextpublic void parse(InputStream stream, ContentHandler handler, Metadata metadata, ParseContext context) throws IOException, SAXException, TikaException
parse
in interface Parser
stream
- the source input stream.handler
- handler to usemetadata
- context
- -- set the LanguageCode
in the ParseContext if knownTikaException
- When there is an error transcribing.IOException
- If an I/O exception of some sort has occurred.SAXException
- if the SAX events could not be processedpublic boolean isAvailable()
@Field public void setClientId(String id)
id
- The ID to set.@Field public void setClientSecret(String secret)
secret
- The secret to set.@Field public void setBucket(String bucket)
bucket
- The bucket to set.public void initialize(Map<String,Param> params) throws TikaConfigException
initialize
in interface Initializable
params
- params to use for initializationTikaConfigException
public void checkInitialization(InitializableProblemHandler problemHandler) throws TikaConfigException
checkInitialization
in interface Initializable
problemHandler
- if there is a problem and no
custom initializableProblemHandler has been configured
via Initializable parameters,
this is called to respond.TikaConfigException
Copyright © 2007–2021 The Apache Software Foundation. All rights reserved.