You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tika.apache.org by ni...@apache.org on 2017/03/23 00:16:40 UTC

[tika] branch 2.x updated (e3fead4 -> 78c31eb)

This is an automated email from the ASF dual-hosted git repository.

nick pushed a change to branch 2.x
in repository https://gitbox.apache.org/repos/asf/tika.git.

      from  e3fead4   TIKA-2307 -- include finer grained supported types so that users can control includes/excludes with decorator via config
       new  2df5c53   TIKA-1772 More WebVTT magic - for cases with no header, and with custom headers
       new  e34498b   TIKA-1772 More test WebVTT files - no text header, and a custom one
       new  d12c87b   Merge 3c02c4b to the new 2.x test documents area
       new  78c31eb   TIKA-1772 More WebVTT unit tests

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../java/org/apache/tika/mime/TestMimeTypes.java   |  9 +++++++++
 .../org/apache/tika/mime/tika-mimetypes.xml        | 23 ++++++++++++++++++++++
 .../resources/test-documents/testWebVTT_header.vtt |  6 ++++++
 .../resources/test-documents/testWebVTT_simple.vtt | 10 ++++++++++
 4 files changed, 48 insertions(+)
 create mode 100644 tika-test-resources/src/test/resources/test-documents/testWebVTT_header.vtt
 create mode 100644 tika-test-resources/src/test/resources/test-documents/testWebVTT_simple.vtt

-- 
To stop receiving notification emails like this one, please contact
['"commits@tika.apache.org" <co...@tika.apache.org>'].

[tika] 04/04: TIKA-1772 More WebVTT unit tests

Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

nick pushed a commit to branch 2.x
in repository https://gitbox.apache.org/repos/asf/tika.git

commit 78c31eb614231d8f75f87a09fa0d3eef9e3010ba
Author: Nick Burch <ni...@gagravarr.org>
AuthorDate: Wed Mar 22 23:27:05 2017 +0000

    TIKA-1772 More WebVTT unit tests
---
 tika-app/src/test/java/org/apache/tika/mime/TestMimeTypes.java | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/tika-app/src/test/java/org/apache/tika/mime/TestMimeTypes.java b/tika-app/src/test/java/org/apache/tika/mime/TestMimeTypes.java
index 3ea0bbe..a69ae4c 100644
--- a/tika-app/src/test/java/org/apache/tika/mime/TestMimeTypes.java
+++ b/tika-app/src/test/java/org/apache/tika/mime/TestMimeTypes.java
@@ -970,8 +970,17 @@ public class TestMimeTypes extends TikaTest {
 
     @Test
     public void testWebVTT() throws Exception {
+        // With the most common text header
         assertType("text/vtt", "testWebVTT.vtt");
         assertTypeByData("text/vtt", "testWebVTT.vtt");
+
+        // With no text header, just plain WebVTT one
+        assertType("text/vtt", "testWebVTT_simple.vtt");
+        assertTypeByData("text/vtt", "testWebVTT_simple.vtt");
+
+        // With a custom text header
+        assertType("text/vtt", "testWebVTT_header.vtt");
+        assertTypeByData("text/vtt", "testWebVTT_header.vtt");
     }
 
     @Test

-- 
To stop receiving notification emails like this one, please contact
"commits@tika.apache.org" <co...@tika.apache.org>.

[tika] 02/04: TIKA-1772 More test WebVTT files - no text header, and a custom one

Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

nick pushed a commit to branch 2.x
in repository https://gitbox.apache.org/repos/asf/tika.git

commit e34498bbefc87038511e3077a80cf71d8c8fc98b
Author: Nick Burch <ni...@gagravarr.org>
AuthorDate: Wed Mar 22 23:26:28 2017 +0000

    TIKA-1772 More test WebVTT files - no text header, and a custom one
---
 .../src/test/resources/test-documents/testWebVTT_header.vtt    |  6 ++++++
 .../src/test/resources/test-documents/testWebVTT_simple.vtt    | 10 ++++++++++
 2 files changed, 16 insertions(+)

diff --git a/tika-parsers/src/test/resources/test-documents/testWebVTT_header.vtt b/tika-parsers/src/test/resources/test-documents/testWebVTT_header.vtt
new file mode 100644
index 0000000..01641bf
--- /dev/null
+++ b/tika-parsers/src/test/resources/test-documents/testWebVTT_header.vtt
@@ -0,0 +1,6 @@
+WEBVTT - This file has cues.
+
+14
+00:01:14.815 --> 00:01:18.114
+- What?
+- Where are we now?
diff --git a/tika-parsers/src/test/resources/test-documents/testWebVTT_simple.vtt b/tika-parsers/src/test/resources/test-documents/testWebVTT_simple.vtt
new file mode 100644
index 0000000..ae23a17
--- /dev/null
+++ b/tika-parsers/src/test/resources/test-documents/testWebVTT_simple.vtt
@@ -0,0 +1,10 @@
+WEBVTT
+
+00:01.000 --> 00:04.000
+- Never drink liquid nitrogen.
+
+00:05.000 --> 00:09.000
+- It will perforate your stomach.
+- You could die.
+
+NOTE This is the last line in the file

-- 
To stop receiving notification emails like this one, please contact
"commits@tika.apache.org" <co...@tika.apache.org>.

[tika] 03/04: Merge 3c02c4b to the new 2.x test documents area

Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

nick pushed a commit to branch 2.x
in repository https://gitbox.apache.org/repos/asf/tika.git

commit d12c87b6d65f36e4e2d8cfbc766bbe4aa35fe5c9
Author: Nick Burch <ni...@gagravarr.org>
AuthorDate: Thu Mar 23 00:15:03 2017 +0000

    Merge 3c02c4b to the new 2.x test documents area
---
 .../src/test/resources/test-documents/testWebVTT_header.vtt               | 0
 .../src/test/resources/test-documents/testWebVTT_simple.vtt               | 0
 2 files changed, 0 insertions(+), 0 deletions(-)

diff --git a/tika-parsers/src/test/resources/test-documents/testWebVTT_header.vtt b/tika-test-resources/src/test/resources/test-documents/testWebVTT_header.vtt
similarity index 100%
rename from tika-parsers/src/test/resources/test-documents/testWebVTT_header.vtt
rename to tika-test-resources/src/test/resources/test-documents/testWebVTT_header.vtt
diff --git a/tika-parsers/src/test/resources/test-documents/testWebVTT_simple.vtt b/tika-test-resources/src/test/resources/test-documents/testWebVTT_simple.vtt
similarity index 100%
rename from tika-parsers/src/test/resources/test-documents/testWebVTT_simple.vtt
rename to tika-test-resources/src/test/resources/test-documents/testWebVTT_simple.vtt

-- 
To stop receiving notification emails like this one, please contact
"commits@tika.apache.org" <co...@tika.apache.org>.

[tika] 01/04: TIKA-1772 More WebVTT magic - for cases with no header, and with custom headers

Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

nick pushed a commit to branch 2.x
in repository https://gitbox.apache.org/repos/asf/tika.git

commit 2df5c536bd3a37660dab5914a385097ed1f39560
Author: Nick Burch <ni...@gagravarr.org>
AuthorDate: Wed Mar 22 23:25:52 2017 +0000

    TIKA-1772 More WebVTT magic - for cases with no header, and with custom headers
---
 .../org/apache/tika/mime/tika-mimetypes.xml        | 23 ++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml b/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml
index 14472f9..6fd9fd3 100644
--- a/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml
+++ b/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml
@@ -5842,9 +5842,32 @@
     <_comment>Web Video Text Tracks Format</_comment>
     <acronym>WebVTT</acronym>
     <magic priority="40">
+      <!-- Simple Form -->
+      <match value="WEBVTT\r" type="string" offset="0"/>
+      <match value="WEBVTT\n" type="string" offset="0"/>
+      <!-- With Byte Order Mark -->
+      <match value="0xfeff" offset="0">
+         <match value="WEBVTT\r" type="string" offset="2"/>
+      </match>
+      <match value="0xfeff" offset="0">
+         <match value="WEBVTT\n" type="string" offset="2"/>
+      </match>
+      <!-- Common Header -->
       <match value="WEBVTT FILE\r" type="string" offset="0"/>
       <match value="WEBVTT FILE\n" type="string" offset="0"/>
     </magic>
+    <magic priority="30">
+      <!-- With a custom header - needs a lower priority -->
+      <match value="WEBVTT " type="string" offset="0">
+        <match value="\n\n" type="string" offset="10:50" />
+      </match>
+      <match value="WEBVTT " type="string" offset="0">
+        <match value="\r\r" type="string" offset="10:50" />
+      </match>
+      <match value="WEBVTT " type="string" offset="0">
+        <match value="\r\n\r\n" type="string" offset="10:50" />
+      </match>
+    </magic>
     <glob pattern="*.vtt"/>
     <sub-class-of type="text/plain"/>
   </mime-type>

-- 
To stop receiving notification emails like this one, please contact
"commits@tika.apache.org" <co...@tika.apache.org>.