내가 구문 분석하려고했다 iWorksDoc을 함께 아파치 티카 . 그러나 콘텐츠 처리기에서 다른 출력을 얻는 대신 구문 분석 된 콘텐츠를 얻지 못합니다. 내가 사용한 코드 스 니펫과 내가 얻은 출력이 아래에 추가됩니다.
private void parseFile(File file) {
try{
File file = new File("/home/user/tika/samples/budget.numbers");
FileInputStream inputStream = new FileInputStream(file);
ParseContext context = new ParseContext();
BodyContentHandler bodyHandler = new BodyContentHandler(-1);
Parser parser=new AutoDetectParser();
parser.parse(inputStream, bodyHandler, new Metadata(), context);
System.out.println("Contents of the file :"+bodyHandler.toString());
}
catch(IOException | SAXException | TikaException e){
e.printStackTrace();
}
}
출력 :-
Contents of the file :
Index/Document.iwa
Index/ViewState.iwa
Index/CalculationEngine.iwa
Index/Tables/HeaderStorageBucket-2.iwa
Index/Tables/Tile.iwa
Index/Metadata.iwa
Metadata/Properties.plist
Detector api를 올바르게 사용하여 파일 형식을 감지 할 수 있습니다. 그러나 문서에서 유용한 내용을 얻지 못하고 있습니다. 도와주세요!
Tika는 Numbers 문서를 구문 분석 할 수 있어야합니다. 문서를 공유 할 수있는 경우 Jira에 게시하십시오 . 파서를 살펴보면 네임 스페이스를 좀 더 견고하게 처리 할 수 있으며 문제 가 될 수 있지만 문서 없이는 알 수 없습니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다