Revision: 14948
          http://gate.svn.sourceforge.net/gate/?rev=14948&view=rev
Author:   valyt
Date:     2012-01-09 12:47:03 +0000 (Mon, 09 Jan 2012)
Log Message:
-----------
Updated to latest Tika version (1.0).

Modified Paths:
--------------
    gate/trunk/.classpath
    gate/trunk/src/gate/corpora/TikaFormat.java

Added Paths:
-----------
    gate/trunk/lib/tika-core-1.0.jar
    gate/trunk/lib/tika-parsers-1.0.jar

Removed Paths:
-------------
    gate/trunk/lib/tika-core-0.9.jar
    gate/trunk/lib/tika-parsers-0.9.jar

Modified: gate/trunk/.classpath
===================================================================
--- gate/trunk/.classpath       2012-01-09 12:32:11 UTC (rev 14947)
+++ gate/trunk/.classpath       2012-01-09 12:47:03 UTC (rev 14948)
@@ -122,13 +122,13 @@
        <classpathentry kind="lib" path="lib/poi-ooxml-3.7.jar"/>
        <classpathentry kind="lib" path="lib/poi-ooxml-schemas-3.7.jar"/>
        <classpathentry kind="lib" path="lib/poi-scratchpad-3.7.jar"/>
-       <classpathentry kind="lib" path="lib/tika-core-0.9.jar"/>
-       <classpathentry kind="lib" path="lib/tika-parsers-0.9.jar"/>
        <classpathentry kind="lib" path="lib/apache-mime4j-0.6.jar"/>
        <classpathentry kind="lib" path="lib/fontbox-1.6.0.jar"/>
        <classpathentry kind="lib" 
path="lib/metadata-extractor-2.4.0-beta-1.jar"/>
        <classpathentry kind="lib" 
path="plugins/JAPE_Plus/lib/colt-1.2.0-free.jar"/>
        <classpathentry kind="lib" 
path="plugins/Ontology/lib/openrdf-sesame-2.6.1-onejar.jar"/>
        <classpathentry kind="lib" 
path="plugins/Ontology/lib/owlim-lite-4.3.jar"/>
+       <classpathentry kind="lib" path="lib/tika-core-1.0.jar"/>
+       <classpathentry kind="lib" path="lib/tika-parsers-1.0.jar"/>
        <classpathentry kind="output" path="classes"/>
 </classpath>

Deleted: gate/trunk/lib/tika-core-0.9.jar
===================================================================
(Binary files differ)

Added: gate/trunk/lib/tika-core-1.0.jar
===================================================================
(Binary files differ)


Property changes on: gate/trunk/lib/tika-core-1.0.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Deleted: gate/trunk/lib/tika-parsers-0.9.jar
===================================================================
(Binary files differ)

Added: gate/trunk/lib/tika-parsers-1.0.jar
===================================================================
(Binary files differ)


Property changes on: gate/trunk/lib/tika-parsers-1.0.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Modified: gate/trunk/src/gate/corpora/TikaFormat.java
===================================================================
--- gate/trunk/src/gate/corpora/TikaFormat.java 2012-01-09 12:32:11 UTC (rev 
14947)
+++ gate/trunk/src/gate/corpora/TikaFormat.java 2012-01-09 12:47:03 UTC (rev 
14948)
@@ -95,7 +95,6 @@
       }
     };
 
-    Parser tikaParser = createParser();
     XmlDocumentHandler ch = new XmlDocumentHandler(doc, this.markupElementsMap,
             this.element2StringMap);
     Metadata metadata = extractParserTips(doc);
@@ -106,6 +105,7 @@
     ch.setAmpCodingInfo(ampCodingInfo);
     InputStream input = null;     
     try {
+      Parser tikaParser = new TikaConfig().getParser();      
       input = doc.getSourceUrl().openStream();
       tikaParser.parse(input, ch, metadata, new ParseContext());
       setDocumentFeatures(metadata, doc);
@@ -126,18 +126,6 @@
     }
   }
 
-  private Parser createParser() {
-    Parser fallback = new AutoDetectParser();
-    TikaConfig conf = TikaConfig.getDefaultConfig();
-    
-    // This composite parser will always honor the input mime type
-    // if the mimetype isn't recognized it will use the auto detect parser
-    CompositeParser p = new CompositeParser();
-    p.setFallback(fallback);
-    p.setParsers(conf.getParsers());
-    return p;
-  }
-
   private void setDocumentFeatures(Metadata metadata, Document doc) {
     Map fmap = doc.getFeatures();
     setTikaFeature(metadata, Metadata.TITLE, fmap);

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to