Class AmazonTranscribe
- java.lang.Object
-
- org.apache.tika.parser.transcribe.aws.AmazonTranscribe
-
- All Implemented Interfaces:
Serializable
,Initializable
,Parser
public class AmazonTranscribe extends Object implements Parser, Initializable
Amazon Transcribe implementation. See Javadoc for configuration options.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.
- Since:
- Tika 2.0
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static Set<MediaType>
SUPPORTED_TYPES
-
Constructor Summary
Constructors Constructor Description AmazonTranscribe()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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)
-
-
-
Method Detail
-
getSupportedTypes
public Set<MediaType> getSupportedTypes(ParseContext context)
Description copied from interface:Parser
Returns the set of media types supported by this parser when used with the given parse context.- Specified by:
getSupportedTypes
in interfaceParser
- Parameters:
context
- parse context- Returns:
- immutable set of media types
-
parse
public void parse(InputStream stream, ContentHandler handler, Metadata metadata, ParseContext context) throws IOException, SAXException, TikaException
Starts AWS Transcribe Job with language specification.- Specified by:
parse
in interfaceParser
- Parameters:
stream
- the source input stream.handler
- handler to usemetadata
-context
- -- set theLanguageCode
in the ParseContext if known- Throws:
TikaException
- 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 processed- See Also:
- AWS Language Code
-
isAvailable
public boolean isAvailable()
- Returns:
- true if this Transcriber is probably able to transcribe right now.
- Since:
- Tika 2.1
-
setClientId
@Field public void setClientId(String id)
Sets the client Id for the transcriber API.- Parameters:
id
- The ID to set.
-
setClientSecret
@Field public void setClientSecret(String secret)
Sets the client secret for the transcriber API.- Parameters:
secret
- The secret to set.
-
setBucket
@Field public void setBucket(String bucket)
Sets the client secret for the transcriber API.- Parameters:
bucket
- The bucket to set.
-
initialize
public void initialize(Map<String,Param> params) throws TikaConfigException
- Specified by:
initialize
in interfaceInitializable
- Parameters:
params
- params to use for initialization- Throws:
TikaConfigException
-
checkInitialization
public void checkInitialization(InitializableProblemHandler problemHandler) throws TikaConfigException
- Specified by:
checkInitialization
in interfaceInitializable
- Parameters:
problemHandler
- if there is a problem and no custom initializableProblemHandler has been configured via Initializable parameters, this is called to respond.- Throws:
TikaConfigException
-
-