[ 
https://issues.apache.org/jira/browse/TIKA-3153?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17175056#comment-17175056
 ] 

Tim Allison commented on TIKA-3153:
-----------------------------------

Could we add a MinShouldMatchClause?  Terminology is stolen directly from 
Lucene...

This would be "match at least two of the following":

{noformat}
      <match minShouldMatch="2">
        <match value="\nMessage-ID:" type="stringignorecase" offset="0:1000"/>
        <match value="\nReturn-Path:" type="stringignorecase" offset="0:1000"/>
        <match value="\nX-Originating-IP:" type="stringignorecase" 
offset="0:1000"/>
        <match value="\nReceived:" type="stringignorecase" offset="0:1000"/>
        <match value="\nDate:" type="stringignorecase" offset="0:1000"/>
        <match value="\nFrom:" type="stringignorecase" offset="0:1000"/>
      </match>
{noformat}

This _should_ improve precision/recall for rfc822...

The more we can do in the mime-types.xml and the less we have to do with custom 
detectors, the better...I think...

> Text File identified as message/rfc822
> --------------------------------------
>
>                 Key: TIKA-3153
>                 URL: https://issues.apache.org/jira/browse/TIKA-3153
>             Project: Tika
>          Issue Type: Bug
>          Components: detector
>    Affects Versions: 1.24.1
>            Reporter: Akash
>            Priority: Major
>         Attachments: TextFileIdentifiedAsMessage.txt
>
>
> Text file containing the word Received: is identified as message/rfc22.
> We were earlier using version 1.9 and it used to identify file type properly 
> as text/plain.
> Even if multiple lines are there, if one line with Received: is present, 
> content type is incorrectly identified.
> To check we can run java -jar tika-app-1.24.1.jar 
> TextFileIdentifiedAsMessage.txt



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to