本文整理了Java中org.apache.uima.cas.CAS.getSofaMimeType()
方法的一些代码示例,展示了CAS.getSofaMimeType()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。CAS.getSofaMimeType()
方法的具体详情如下:
包路径:org.apache.uima.cas.CAS
类名称:CAS
方法名:getSofaMimeType
[英]Get the mime type of the Sofa data being analyzed.
[中]获取正在分析的Sofa数据的mime类型。
代码示例来源:origin: org.apache.uima/uimafit-core
private void processSofaData(CAS aCAS) throws AnalysisEngineProcessException {
out.println("Sofa data:");
//
// Mime type
String mimeType = aCAS.getSofaMimeType();
if (mimeType != null) {
out.println(" mime type:\t" + mimeType);
}
// Data
byte[] bytes = null;
InputStream in = null;
try {
in = aCAS.getSofaDataStream();
bytes = IOUtils.toByteArray(in);
} catch (IOException e) {
throw new AnalysisEngineProcessException(e);
} finally {
IOUtils.closeQuietly(in);
}
if (bytes != null) {
// Data size
out.println(" size:\t" + bytes.length + " byte(s)");
// Hash value of the bytes
String hash = DigestUtils.md5DigestAsHex(bytes);
out.println(" hash value:\t" + hash);
}
out.println();
}
代码示例来源:origin: de.tudarmstadt.ukp.dkpro.core/de.tudarmstadt.ukp.dkpro.core.testing-asl
String mimeType = aCAS.getSofaMimeType();
if (mimeType != null) {
out.println(" mime type:\t" + mimeType);
代码示例来源:origin: dkpro/dkpro-core
String mimeType = aCAS.getSofaMimeType();
if (mimeType != null) {
out.println(" mime type:\t" + mimeType);
内容来源于网络,如有侵权,请联系作者删除!