tika-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rida Benjelloun (JIRA)" <j...@apache.org>
Subject [jira] Created: (TIKA-7) Lius Lite remove all lucene dependencies from Lius and use Nutch office parsers
Date Sun, 10 Jun 2007 05:24:26 GMT
Lius Lite remove all lucene dependencies from Lius  and use Nutch office parsers

                 Key: TIKA-7
                 URL: https://issues.apache.org/jira/browse/TIKA-7
             Project: Tika
          Issue Type: New Feature
          Components: general
         Environment: Java 1.5
            Reporter: Rida Benjelloun

This is a work in progress of Lius. The release remove all Lucene dependencies and use Nutch
Office parsers because they are based on Apache POI.
Lius Lite offer 4 ways  for content extraction :
- Document fulltext extraction
- XPath extraction
- Regex extraction
- Document metadata extraction (not implemented for all parsers)

Lius Lite use an XML config file to configure the parsers and the information to extract.
 Please see config.xml in the config folder
See also Junit tests.
Here is an example  of XML parsing :
1- XML Config
		<parser name="text-xml" class="liuslite.parser.xml.XMLParser">			
					<content name="title" xpathSelect="//dc:title"/>
					<content name="subject" xpathSelect="//dc:subject"/>
					<content name="creator" xpathSelect="//dc:creator"/>
					<content name="description" xpathSelect="//dc:description"/>
					<content name="publisher" xpathSelect="//dc:publisher"/>
					<content name="contributor" xpathSelect="//dc:contributor"/>
					<content name="type" xpathSelect="//dc:type"/>
					<content name="format" xpathSelect="//dc:format"/>
					<content name="identifier" xpathSelect="//dc:identifier"/>
					<content name="language" xpathSelect="//dc:language"/>
					<content name="rights" xpathSelect="//dc:rights"/>
					<content name="outLinks">

2- XML Document
<oaidc:dc xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:oaidc="http://www.openarchives.org/OAI/2.0/oai_dc/">
	<dc:title>Archim├Ęde et Lius</dc:title>
	<dc:creator>Rida Benjelloun</dc:creator>
	<dc:description>Framework d'indexation des documents XML, HTML, PDF etc.. </dc:description>
	<dc:rights>Non restreint</dc:rights>	

3- Java Code 

LiusConfig lc = LiusConfig.getInstance(configPathString);

File testFile = new File("test.xml");
try {
	Parser  parser = ParserFactory.getParser(testFile, lc);
        String fullText = parser.getContentStr();
        Content title = parser.getContent("title");
        String titleStr = title.getValue();
        Content subject = parser.getContent("subject");
        String[] subjects = subject.getValues();

        etc ...

        Or : 
        List<Content> contents = parser.getContents();
     } catch (MimeInfoException e) {
     } catch (IOException e) {
     } catch (LiusException e) {

best regards
Rida Benjelloun

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message