You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tika.apache.org by ta...@apache.org on 2020/09/01 19:25:24 UTC
[tika] 02/02: TIKA-3176 -- modularize language detectors
This is an automated email from the ASF dual-hosted git repository.
tallison pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tika.git
commit c2a25674dbbafaae335d9066ec72bbb294bdb655
Author: tallison <ta...@apache.org>
AuthorDate: Tue Sep 1 15:23:54 2020 -0400
TIKA-3176 -- modularize language detectors
---
pom.xml | 2 +-
tika-app/pom.xml | 2 +-
tika-langdetect/pom.xml | 227 +++------------------
tika-langdetect/tika-langdetect-commons/pom.xml | 46 +++++
.../tika/langdetect/LanguageDetectorTest.java | 3 +-
.../src/test/resources/log4j.properties | 0
.../apache/tika/langdetect/language-tests/da.test | 0
.../apache/tika/langdetect/language-tests/de.test | 0
.../apache/tika/langdetect/language-tests/el.test | 0
.../apache/tika/langdetect/language-tests/en.test | 0
.../apache/tika/langdetect/language-tests/es.test | 0
.../apache/tika/langdetect/language-tests/et.test | 0
.../apache/tika/langdetect/language-tests/fi.test | 0
.../apache/tika/langdetect/language-tests/fr.test | 0
.../apache/tika/langdetect/language-tests/it.test | 0
.../apache/tika/langdetect/language-tests/ja.test | 0
.../apache/tika/langdetect/language-tests/lt.test | 0
.../apache/tika/langdetect/language-tests/nl.test | 0
.../apache/tika/langdetect/language-tests/pt.test | 0
.../apache/tika/langdetect/language-tests/sv.test | 0
.../apache/tika/langdetect/language-tests/th.test | 0
.../apache/tika/langdetect/language-tests/zh.test | 0
.../org/apache/tika/langdetect/text-test.tsv | 0
tika-langdetect/tika-langdetect-lingo24/pom.xml | 74 +++++++
.../langdetect/lingo24}/Lingo24LangDetector.java | 2 +-
...rg.apache.tika.language.detect.LanguageDetector | 2 +-
.../lingo24}/langdetect.lingo24.properties | 0
.../lingo24}/Lingo24LangDetectorTest.java | 19 +-
tika-langdetect/tika-langdetect-mitll-text/pom.xml | 73 +++++++
.../tika/langdetect/mitll}/TextLangDetector.java | 2 +-
...rg.apache.tika.language.detect.LanguageDetector | 2 +-
.../langdetect/mitll}/TextLangDetectorTest.java | 12 +-
.../src/test/resources/log4j.properties | 0
tika-langdetect/tika-langdetect-optimaize/pom.xml | 55 +++++
.../optimaize}/OptimaizeLangDetector.java | 2 +-
...rg.apache.tika.language.detect.LanguageDetector | 2 +-
.../optimaize}/OptimaizeLangDetectorTest.java | 3 +-
.../tika/langdetect/optimaize}/language-codes.txt | 0
.../tika/langdetect/optimaize}/udhr-known.txt | 0
.../tika/langdetect/optimaize}/udhr-unknown.txt | 0
tika-server/pom.xml | 2 +-
.../tika/server/resource/LanguageResource.java | 3 +-
.../tika/server/resource/TranslateResource.java | 2 +-
tika-translate/pom.xml | 26 ++-
.../language/translate/AbstractTranslator.java | 2 +-
45 files changed, 342 insertions(+), 221 deletions(-)
diff --git a/pom.xml b/pom.xml
index 1fa7a53..cc3c98e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -44,11 +44,11 @@
<module>tika-xmp</module>
<module>tika-serialization</module>
<module>tika-batch</module>
+ <module>tika-langdetect</module>
<module>tika-app</module>
<module>tika-server</module>
<module>tika-fuzzing</module>
<module>tika-translate</module>
- <module>tika-langdetect</module>
<module>tika-example</module>
<module>tika-java7</module>
<module>tika-eval</module>
diff --git a/tika-app/pom.xml b/tika-app/pom.xml
index b5d7afb..c917358 100644
--- a/tika-app/pom.xml
+++ b/tika-app/pom.xml
@@ -45,7 +45,7 @@
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
- <artifactId>tika-langdetect</artifactId>
+ <artifactId>tika-langdetect-optimaize</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
diff --git a/tika-langdetect/pom.xml b/tika-langdetect/pom.xml
index 9b18fe4..b1fa8b3 100644
--- a/tika-langdetect/pom.xml
+++ b/tika-langdetect/pom.xml
@@ -1,196 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.tika</groupId>
- <artifactId>tika-parent</artifactId>
- <version>2.0.0-SNAPSHOT</version>
- <relativePath>../tika-parent/pom.xml</relativePath>
- </parent>
-
- <artifactId>tika-langdetect</artifactId>
- <packaging>bundle</packaging>
- <name>Apache Tika language detection</name>
- <url>http://tika.apache.org/</url>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tika</groupId>
- <artifactId>tika-core</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <!-- for java 10
- See TIKA-2778 for why we need to do this now.
- May the gods of dependency management fix this in the future.
- -->
- <dependency>
- <groupId>org.glassfish.jaxb</groupId>
- <artifactId>jaxb-runtime</artifactId>
- <version>${jaxb.version}</version>
- </dependency>
- <dependency>
- <groupId>com.optimaize.languagedetector</groupId>
- <artifactId>language-detector</artifactId>
- <version>${optimaize.version}</version>
- <exclusions>
- <exclusion>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <!-- exclude and then add back in to avoid
- conflicts with edu.ucar:cdm in tika-parsers -->
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- <version>${guava.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.cxf</groupId>
- <artifactId>cxf-rt-rs-client</artifactId>
- <version>${cxf.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.glassfish.jaxb</groupId>
- <artifactId>jaxb-runtime</artifactId>
- </exclusion>
- <exclusion>
- <groupId>jakarta.xml.bind</groupId>
- <artifactId>jakarta.xml.bind-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- <version>${gson.version}</version>
- </dependency>
-
- <!-- Test dependencies -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <version>${maven.bundle.version}</version>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Bundle-DocURL>${project.url}</Bundle-DocURL>
- <Bundle-Activator>
- org.apache.tika.parser.internal.Activator
- </Bundle-Activator>
- <Import-Package>
- org.w3c.dom,
- org.apache.tika.*,
- *;resolution:=optional
- </Import-Package>
- </instructions>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.rat</groupId>
- <artifactId>apache-rat-plugin</artifactId>
- <version>${rat.version}</version>
- <configuration>
- <excludes>
- <exclude>src/test/resources/org/apache/tika/langdetect/*</exclude>
- <exclude>src/test/resources/org/apache/tika/langdetect/language-tests/*</exclude>
-
- </excludes>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <archive>
- <manifestEntries>
- <Automatic-Module-Name>org.apache.tika.langdetect</Automatic-Module-Name>
- </manifestEntries>
- </archive>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>test-jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
-
- <pluginManagement>
- <plugins>
- <!-- This plugin's configuration is used to store Eclipse m2e -->
- <!-- settings only. It has no influence on the Maven build itself. -->
- <plugin>
- <groupId>org.eclipse.m2e</groupId>
- <artifactId>lifecycle-mapping</artifactId>
- <version>1.0.0</version>
- <configuration>
- <lifecycleMappingMetadata>
- <pluginExecutions>
- <pluginExecution>
- <pluginExecutionFilter>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-scr-plugin</artifactId>
- <version>${maven.scr.version}</version>
- <goals>
- <goal>scr</goal>
- </goals>
- </pluginExecutionFilter>
- <action>
- <execute />
- </action>
- </pluginExecution>
- </pluginExecutions>
- </lifecycleMappingMetadata>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
- </build>
-
- <description>This is the language detection Apache Tika™ toolkit.
- </description>
- <organization>
- <name>The Apache Software Foundation</name>
- <url>http://www.apache.org</url>
- </organization>
-</project>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <groupId>org.apache.tika</groupId>
+ <artifactId>tika-parent</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ <relativePath>../tika-parent/pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>tika-langdetect</artifactId>
+ <packaging>pom</packaging>
+ <name>Apache Tika language detection</name>
+ <url>http://tika.apache.org/</url>
+
+ <modules>
+ <module>tika-langdetect-commons</module>
+ <module>tika-langdetect-lingo24</module>
+ <module>tika-langdetect-optimaize</module>
+ <module>tika-langdetect-mitll-text</module>
+ </modules>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+</project>
\ No newline at end of file
diff --git a/tika-langdetect/tika-langdetect-commons/pom.xml b/tika-langdetect/tika-langdetect-commons/pom.xml
new file mode 100644
index 0000000..0c34704
--- /dev/null
+++ b/tika-langdetect/tika-langdetect-commons/pom.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <artifactId>tika-langdetect</artifactId>
+ <groupId>org.apache.tika</groupId>
+ <version>2.0.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>tika-langdetect-commons</artifactId>
+
+
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>tika-core</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifestEntries>
+ <Automatic-Module-Name>org.apache.tika.langdetect.commons</Automatic-Module-Name>
+ </manifestEntries>
+ </archive>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
\ No newline at end of file
diff --git a/tika-langdetect/src/test/java/org/apache/tika/langdetect/LanguageDetectorTest.java b/tika-langdetect/tika-langdetect-commons/src/test/java/org/apache/tika/langdetect/LanguageDetectorTest.java
similarity index 95%
rename from tika-langdetect/src/test/java/org/apache/tika/langdetect/LanguageDetectorTest.java
rename to tika-langdetect/tika-langdetect-commons/src/test/java/org/apache/tika/langdetect/LanguageDetectorTest.java
index 726219b..8120e67 100644
--- a/tika-langdetect/src/test/java/org/apache/tika/langdetect/LanguageDetectorTest.java
+++ b/tika-langdetect/tika-langdetect-commons/src/test/java/org/apache/tika/langdetect/LanguageDetectorTest.java
@@ -23,7 +23,6 @@ import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.io.Writer;
-import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
@@ -35,7 +34,7 @@ public abstract class LanguageDetectorTest {
List<String> result = new ArrayList<>();
List<String> lines = IOUtils.readLines(
- LanguageDetectorTest.class.getResourceAsStream("language-codes.txt"),
+ this.getClass().getResourceAsStream("language-codes.txt"),
UTF_8);
for (String line : lines) {
line = line.trim();
diff --git a/tika-langdetect/src/test/resources/log4j.properties b/tika-langdetect/tika-langdetect-commons/src/test/resources/log4j.properties
similarity index 100%
copy from tika-langdetect/src/test/resources/log4j.properties
copy to tika-langdetect/tika-langdetect-commons/src/test/resources/log4j.properties
diff --git a/tika-langdetect/src/test/resources/org/apache/tika/langdetect/language-tests/da.test b/tika-langdetect/tika-langdetect-commons/src/test/resources/org/apache/tika/langdetect/language-tests/da.test
similarity index 100%
rename from tika-langdetect/src/test/resources/org/apache/tika/langdetect/language-tests/da.test
rename to tika-langdetect/tika-langdetect-commons/src/test/resources/org/apache/tika/langdetect/language-tests/da.test
diff --git a/tika-langdetect/src/test/resources/org/apache/tika/langdetect/language-tests/de.test b/tika-langdetect/tika-langdetect-commons/src/test/resources/org/apache/tika/langdetect/language-tests/de.test
similarity index 100%
rename from tika-langdetect/src/test/resources/org/apache/tika/langdetect/language-tests/de.test
rename to tika-langdetect/tika-langdetect-commons/src/test/resources/org/apache/tika/langdetect/language-tests/de.test
diff --git a/tika-langdetect/src/test/resources/org/apache/tika/langdetect/language-tests/el.test b/tika-langdetect/tika-langdetect-commons/src/test/resources/org/apache/tika/langdetect/language-tests/el.test
similarity index 100%
rename from tika-langdetect/src/test/resources/org/apache/tika/langdetect/language-tests/el.test
rename to tika-langdetect/tika-langdetect-commons/src/test/resources/org/apache/tika/langdetect/language-tests/el.test
diff --git a/tika-langdetect/src/test/resources/org/apache/tika/langdetect/language-tests/en.test b/tika-langdetect/tika-langdetect-commons/src/test/resources/org/apache/tika/langdetect/language-tests/en.test
similarity index 100%
rename from tika-langdetect/src/test/resources/org/apache/tika/langdetect/language-tests/en.test
rename to tika-langdetect/tika-langdetect-commons/src/test/resources/org/apache/tika/langdetect/language-tests/en.test
diff --git a/tika-langdetect/src/test/resources/org/apache/tika/langdetect/language-tests/es.test b/tika-langdetect/tika-langdetect-commons/src/test/resources/org/apache/tika/langdetect/language-tests/es.test
similarity index 100%
rename from tika-langdetect/src/test/resources/org/apache/tika/langdetect/language-tests/es.test
rename to tika-langdetect/tika-langdetect-commons/src/test/resources/org/apache/tika/langdetect/language-tests/es.test
diff --git a/tika-langdetect/src/test/resources/org/apache/tika/langdetect/language-tests/et.test b/tika-langdetect/tika-langdetect-commons/src/test/resources/org/apache/tika/langdetect/language-tests/et.test
similarity index 100%
rename from tika-langdetect/src/test/resources/org/apache/tika/langdetect/language-tests/et.test
rename to tika-langdetect/tika-langdetect-commons/src/test/resources/org/apache/tika/langdetect/language-tests/et.test
diff --git a/tika-langdetect/src/test/resources/org/apache/tika/langdetect/language-tests/fi.test b/tika-langdetect/tika-langdetect-commons/src/test/resources/org/apache/tika/langdetect/language-tests/fi.test
similarity index 100%
rename from tika-langdetect/src/test/resources/org/apache/tika/langdetect/language-tests/fi.test
rename to tika-langdetect/tika-langdetect-commons/src/test/resources/org/apache/tika/langdetect/language-tests/fi.test
diff --git a/tika-langdetect/src/test/resources/org/apache/tika/langdetect/language-tests/fr.test b/tika-langdetect/tika-langdetect-commons/src/test/resources/org/apache/tika/langdetect/language-tests/fr.test
similarity index 100%
rename from tika-langdetect/src/test/resources/org/apache/tika/langdetect/language-tests/fr.test
rename to tika-langdetect/tika-langdetect-commons/src/test/resources/org/apache/tika/langdetect/language-tests/fr.test
diff --git a/tika-langdetect/src/test/resources/org/apache/tika/langdetect/language-tests/it.test b/tika-langdetect/tika-langdetect-commons/src/test/resources/org/apache/tika/langdetect/language-tests/it.test
similarity index 100%
rename from tika-langdetect/src/test/resources/org/apache/tika/langdetect/language-tests/it.test
rename to tika-langdetect/tika-langdetect-commons/src/test/resources/org/apache/tika/langdetect/language-tests/it.test
diff --git a/tika-langdetect/src/test/resources/org/apache/tika/langdetect/language-tests/ja.test b/tika-langdetect/tika-langdetect-commons/src/test/resources/org/apache/tika/langdetect/language-tests/ja.test
similarity index 100%
rename from tika-langdetect/src/test/resources/org/apache/tika/langdetect/language-tests/ja.test
rename to tika-langdetect/tika-langdetect-commons/src/test/resources/org/apache/tika/langdetect/language-tests/ja.test
diff --git a/tika-langdetect/src/test/resources/org/apache/tika/langdetect/language-tests/lt.test b/tika-langdetect/tika-langdetect-commons/src/test/resources/org/apache/tika/langdetect/language-tests/lt.test
similarity index 100%
rename from tika-langdetect/src/test/resources/org/apache/tika/langdetect/language-tests/lt.test
rename to tika-langdetect/tika-langdetect-commons/src/test/resources/org/apache/tika/langdetect/language-tests/lt.test
diff --git a/tika-langdetect/src/test/resources/org/apache/tika/langdetect/language-tests/nl.test b/tika-langdetect/tika-langdetect-commons/src/test/resources/org/apache/tika/langdetect/language-tests/nl.test
similarity index 100%
rename from tika-langdetect/src/test/resources/org/apache/tika/langdetect/language-tests/nl.test
rename to tika-langdetect/tika-langdetect-commons/src/test/resources/org/apache/tika/langdetect/language-tests/nl.test
diff --git a/tika-langdetect/src/test/resources/org/apache/tika/langdetect/language-tests/pt.test b/tika-langdetect/tika-langdetect-commons/src/test/resources/org/apache/tika/langdetect/language-tests/pt.test
similarity index 100%
rename from tika-langdetect/src/test/resources/org/apache/tika/langdetect/language-tests/pt.test
rename to tika-langdetect/tika-langdetect-commons/src/test/resources/org/apache/tika/langdetect/language-tests/pt.test
diff --git a/tika-langdetect/src/test/resources/org/apache/tika/langdetect/language-tests/sv.test b/tika-langdetect/tika-langdetect-commons/src/test/resources/org/apache/tika/langdetect/language-tests/sv.test
similarity index 100%
rename from tika-langdetect/src/test/resources/org/apache/tika/langdetect/language-tests/sv.test
rename to tika-langdetect/tika-langdetect-commons/src/test/resources/org/apache/tika/langdetect/language-tests/sv.test
diff --git a/tika-langdetect/src/test/resources/org/apache/tika/langdetect/language-tests/th.test b/tika-langdetect/tika-langdetect-commons/src/test/resources/org/apache/tika/langdetect/language-tests/th.test
similarity index 100%
rename from tika-langdetect/src/test/resources/org/apache/tika/langdetect/language-tests/th.test
rename to tika-langdetect/tika-langdetect-commons/src/test/resources/org/apache/tika/langdetect/language-tests/th.test
diff --git a/tika-langdetect/src/test/resources/org/apache/tika/langdetect/language-tests/zh.test b/tika-langdetect/tika-langdetect-commons/src/test/resources/org/apache/tika/langdetect/language-tests/zh.test
similarity index 100%
rename from tika-langdetect/src/test/resources/org/apache/tika/langdetect/language-tests/zh.test
rename to tika-langdetect/tika-langdetect-commons/src/test/resources/org/apache/tika/langdetect/language-tests/zh.test
diff --git a/tika-langdetect/src/test/resources/org/apache/tika/langdetect/text-test.tsv b/tika-langdetect/tika-langdetect-commons/src/test/resources/org/apache/tika/langdetect/text-test.tsv
similarity index 100%
rename from tika-langdetect/src/test/resources/org/apache/tika/langdetect/text-test.tsv
rename to tika-langdetect/tika-langdetect-commons/src/test/resources/org/apache/tika/langdetect/text-test.tsv
diff --git a/tika-langdetect/tika-langdetect-lingo24/pom.xml b/tika-langdetect/tika-langdetect-lingo24/pom.xml
new file mode 100644
index 0000000..cdf1e48
--- /dev/null
+++ b/tika-langdetect/tika-langdetect-lingo24/pom.xml
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <artifactId>tika-langdetect</artifactId>
+ <groupId>org.apache.tika</groupId>
+ <version>2.0.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>tika-langdetect-lingo24</artifactId>
+
+
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>tika-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <!-- for java 10
+ See TIKA-2778 for why we need to do this now.
+ May the gods of dependency management fix this in the future.
+ -->
+ <dependency>
+ <groupId>org.glassfish.jaxb</groupId>
+ <artifactId>jaxb-runtime</artifactId>
+ <version>${jaxb.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-rs-client</artifactId>
+ <version>${cxf.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.glassfish.jaxb</groupId>
+ <artifactId>jaxb-runtime</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>jakarta.xml.bind</groupId>
+ <artifactId>jakarta.xml.bind-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ <version>${gson.version}</version>
+ </dependency>
+
+ <!-- Test dependencies -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>tika-langdetect-commons</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>tika-langdetect-commons</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ <type>test-jar</type>
+ </dependency>
+
+ </dependencies>
+
+</project>
\ No newline at end of file
diff --git a/tika-langdetect/src/main/java/org/apache/tika/langdetect/Lingo24LangDetector.java b/tika-langdetect/tika-langdetect-lingo24/src/main/java/org/apache/tika/langdetect/lingo24/Lingo24LangDetector.java
similarity index 99%
rename from tika-langdetect/src/main/java/org/apache/tika/langdetect/Lingo24LangDetector.java
rename to tika-langdetect/tika-langdetect-lingo24/src/main/java/org/apache/tika/langdetect/lingo24/Lingo24LangDetector.java
index 9ce9548..ca8e31f 100644
--- a/tika-langdetect/src/main/java/org/apache/tika/langdetect/Lingo24LangDetector.java
+++ b/tika-langdetect/tika-langdetect-lingo24/src/main/java/org/apache/tika/langdetect/lingo24/Lingo24LangDetector.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.tika.langdetect;
+package org.apache.tika.langdetect.lingo24;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
diff --git a/tika-langdetect/src/main/resources/META-INF/services/org.apache.tika.language.detect.LanguageDetector b/tika-langdetect/tika-langdetect-lingo24/src/main/resources/META-INF/services/org.apache.tika.language.detect.LanguageDetector
similarity index 93%
copy from tika-langdetect/src/main/resources/META-INF/services/org.apache.tika.language.detect.LanguageDetector
copy to tika-langdetect/tika-langdetect-lingo24/src/main/resources/META-INF/services/org.apache.tika.language.detect.LanguageDetector
index 79fc24e..e463066 100644
--- a/tika-langdetect/src/main/resources/META-INF/services/org.apache.tika.language.detect.LanguageDetector
+++ b/tika-langdetect/tika-langdetect-lingo24/src/main/resources/META-INF/services/org.apache.tika.language.detect.LanguageDetector
@@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-org.apache.tika.langdetect.OptimaizeLangDetector
+org.apache.tika.langdetect.lingo24.Lingo24LangDetector
diff --git a/tika-langdetect/src/main/resources/org/apache/tika/langdetect/langdetect.lingo24.properties b/tika-langdetect/tika-langdetect-lingo24/src/main/resources/org/apache/tika/langdetect/lingo24/langdetect.lingo24.properties
similarity index 100%
rename from tika-langdetect/src/main/resources/org/apache/tika/langdetect/langdetect.lingo24.properties
rename to tika-langdetect/tika-langdetect-lingo24/src/main/resources/org/apache/tika/langdetect/lingo24/langdetect.lingo24.properties
diff --git a/tika-langdetect/src/test/java/org/apache/tika/langdetect/Lingo24LangDetectorTest.java b/tika-langdetect/tika-langdetect-lingo24/src/test/java/org/apache/tika/langdetect/lingo24/Lingo24LangDetectorTest.java
similarity index 83%
rename from tika-langdetect/src/test/java/org/apache/tika/langdetect/Lingo24LangDetectorTest.java
rename to tika-langdetect/tika-langdetect-lingo24/src/test/java/org/apache/tika/langdetect/lingo24/Lingo24LangDetectorTest.java
index 151e877..c04788f 100644
--- a/tika-langdetect/src/test/java/org/apache/tika/langdetect/Lingo24LangDetectorTest.java
+++ b/tika-langdetect/tika-langdetect-lingo24/src/test/java/org/apache/tika/langdetect/lingo24/Lingo24LangDetectorTest.java
@@ -14,14 +14,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.tika.langdetect;
+package org.apache.tika.langdetect.lingo24;
import org.apache.tika.io.IOUtils;
+import org.apache.tika.langdetect.LanguageDetectorTest;
import org.apache.tika.language.detect.LanguageDetector;
import org.apache.tika.language.detect.LanguageResult;
import org.apache.tika.language.detect.LanguageWriter;
import org.junit.Test;
+import java.io.InputStreamReader;
+import java.io.Reader;
import java.nio.charset.StandardCharsets;
import java.util.List;
@@ -31,7 +34,7 @@ import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeTrue;
/**
- * Test harness for the {@link org.apache.tika.langdetect.Lingo24LangDetector}.
+ * Test harness for the {@link org.apache.tika.langdetect.lingo24.Lingo24LangDetector}.
*/
public class Lingo24LangDetectorTest {
@@ -48,14 +51,18 @@ public class Lingo24LangDetectorTest {
@Test
public void testLanguageDetection() throws Exception {
+ // Reusing the test data from OptimaizeLangDetectorTest
+ // Test taht we can at least read the test file
+ List<String> lines = IOUtils.readLines(
+ new InputStreamReader(
+ LanguageDetectorTest.class.getResourceAsStream("text-test.tsv"), StandardCharsets.UTF_8));
+ assertEquals(18, lines.size());
+
LanguageDetector detector = new Lingo24LangDetector();
assumeTrue(((Lingo24LangDetector) detector).isAvailable());
LanguageWriter writer = new LanguageWriter(detector);
- // Reusing the test data from OptimaizeLangDetectorTest
- List<String> lines = IOUtils.readLines(
- Lingo24LangDetectorTest.class.getResourceAsStream("text-test.tsv"),
- StandardCharsets.UTF_8);
+
for (String line : lines) {
String[] data = line.split("\t");
if (data.length != 2) continue;
diff --git a/tika-langdetect/tika-langdetect-mitll-text/pom.xml b/tika-langdetect/tika-langdetect-mitll-text/pom.xml
new file mode 100644
index 0000000..8d6d398
--- /dev/null
+++ b/tika-langdetect/tika-langdetect-mitll-text/pom.xml
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <artifactId>tika-langdetect</artifactId>
+ <groupId>org.apache.tika</groupId>
+ <version>2.0.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>tika-langdetect-mitll-text</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>tika-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <!-- for java 10
+ See TIKA-2778 for why we need to do this now.
+ May the gods of dependency management fix this in the future.
+ -->
+ <dependency>
+ <groupId>org.glassfish.jaxb</groupId>
+ <artifactId>jaxb-runtime</artifactId>
+ <version>${jaxb.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-rs-client</artifactId>
+ <version>${cxf.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.glassfish.jaxb</groupId>
+ <artifactId>jaxb-runtime</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>jakarta.xml.bind</groupId>
+ <artifactId>jakarta.xml.bind-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ <version>${gson.version}</version>
+ </dependency>
+
+ <!-- Test dependencies -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>tika-langdetect-commons</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>tika-langdetect-commons</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ <type>test-jar</type>
+ </dependency>
+
+ </dependencies>
+
+</project>
\ No newline at end of file
diff --git a/tika-langdetect/src/main/java/org/apache/tika/langdetect/TextLangDetector.java b/tika-langdetect/tika-langdetect-mitll-text/src/main/java/org/apache/tika/langdetect/mitll/TextLangDetector.java
similarity index 99%
rename from tika-langdetect/src/main/java/org/apache/tika/langdetect/TextLangDetector.java
rename to tika-langdetect/tika-langdetect-mitll-text/src/main/java/org/apache/tika/langdetect/mitll/TextLangDetector.java
index dd1dbbb..9a692ed 100644
--- a/tika-langdetect/src/main/java/org/apache/tika/langdetect/TextLangDetector.java
+++ b/tika-langdetect/tika-langdetect-mitll-text/src/main/java/org/apache/tika/langdetect/mitll/TextLangDetector.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.tika.langdetect;
+package org.apache.tika.langdetect.mitll;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
diff --git a/tika-langdetect/src/main/resources/META-INF/services/org.apache.tika.language.detect.LanguageDetector b/tika-langdetect/tika-langdetect-mitll-text/src/main/resources/META-INF/services/org.apache.tika.language.detect.LanguageDetector
similarity index 94%
copy from tika-langdetect/src/main/resources/META-INF/services/org.apache.tika.language.detect.LanguageDetector
copy to tika-langdetect/tika-langdetect-mitll-text/src/main/resources/META-INF/services/org.apache.tika.language.detect.LanguageDetector
index 79fc24e..cd768ac 100644
--- a/tika-langdetect/src/main/resources/META-INF/services/org.apache.tika.language.detect.LanguageDetector
+++ b/tika-langdetect/tika-langdetect-mitll-text/src/main/resources/META-INF/services/org.apache.tika.language.detect.LanguageDetector
@@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-org.apache.tika.langdetect.OptimaizeLangDetector
+org.apache.tika.langdetect.mitll.TextLangDetector
diff --git a/tika-langdetect/src/test/java/org/apache/tika/langdetect/TextLangDetectorTest.java b/tika-langdetect/tika-langdetect-mitll-text/src/test/java/org/apache/tika/langdetect/mitll/TextLangDetectorTest.java
similarity index 90%
rename from tika-langdetect/src/test/java/org/apache/tika/langdetect/TextLangDetectorTest.java
rename to tika-langdetect/tika-langdetect-mitll-text/src/test/java/org/apache/tika/langdetect/mitll/TextLangDetectorTest.java
index 023d0b3..00deec8 100644
--- a/tika-langdetect/src/test/java/org/apache/tika/langdetect/TextLangDetectorTest.java
+++ b/tika-langdetect/tika-langdetect-mitll-text/src/test/java/org/apache/tika/langdetect/mitll/TextLangDetectorTest.java
@@ -14,9 +14,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.tika.langdetect;
+package org.apache.tika.langdetect.mitll;
import org.apache.tika.io.IOUtils;
+import org.apache.tika.langdetect.LanguageDetectorTest;
import org.apache.tika.language.detect.LanguageDetector;
import org.apache.tika.language.detect.LanguageResult;
import org.apache.tika.language.detect.LanguageWriter;
@@ -36,14 +37,17 @@ public class TextLangDetectorTest {
@Test
public void test() throws Exception {
+ List<String> lines = IOUtils.readLines(
+ LanguageDetectorTest.class.getResourceAsStream("text-test.tsv"),
+ StandardCharsets.UTF_8);
+
+ assertEquals(18, lines.size());
+
assumeTrue(TextLangDetector.canRun());
LanguageDetector detector = new TextLangDetector();
LanguageWriter writer = new LanguageWriter(detector);
- List<String> lines = IOUtils.readLines(
- TextLangDetectorTest.class.getResourceAsStream("text-test.tsv"),
- StandardCharsets.UTF_8);
for (String line : lines) {
String[] data = line.split("\t");
if (data.length != 2) continue;
diff --git a/tika-langdetect/src/test/resources/log4j.properties b/tika-langdetect/tika-langdetect-mitll-text/src/test/resources/log4j.properties
similarity index 100%
rename from tika-langdetect/src/test/resources/log4j.properties
rename to tika-langdetect/tika-langdetect-mitll-text/src/test/resources/log4j.properties
diff --git a/tika-langdetect/tika-langdetect-optimaize/pom.xml b/tika-langdetect/tika-langdetect-optimaize/pom.xml
new file mode 100644
index 0000000..3899736
--- /dev/null
+++ b/tika-langdetect/tika-langdetect-optimaize/pom.xml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <artifactId>tika-langdetect</artifactId>
+ <groupId>org.apache.tika</groupId>
+ <version>2.0.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>tika-langdetect-optimaize</artifactId>
+
+
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>tika-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.optimaize.languagedetector</groupId>
+ <artifactId>language-detector</artifactId>
+ <version>${optimaize.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <!-- exclude and then add back in to avoid
+ conflicts with edu.ucar:cdm in tika-parsers -->
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ <version>${guava.version}</version>
+ </dependency>
+
+ <!-- test dependencies -->
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>tika-langdetect-commons</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>tika-langdetect-commons</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ <type>test-jar</type>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
diff --git a/tika-langdetect/src/main/java/org/apache/tika/langdetect/OptimaizeLangDetector.java b/tika-langdetect/tika-langdetect-optimaize/src/main/java/org/apache/tika/langdetect/optimaize/OptimaizeLangDetector.java
similarity index 99%
rename from tika-langdetect/src/main/java/org/apache/tika/langdetect/OptimaizeLangDetector.java
rename to tika-langdetect/tika-langdetect-optimaize/src/main/java/org/apache/tika/langdetect/optimaize/OptimaizeLangDetector.java
index 585b748..81d46f7 100644
--- a/tika-langdetect/src/main/java/org/apache/tika/langdetect/OptimaizeLangDetector.java
+++ b/tika-langdetect/tika-langdetect-optimaize/src/main/java/org/apache/tika/langdetect/optimaize/OptimaizeLangDetector.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.tika.langdetect;
+package org.apache.tika.langdetect.optimaize;
import java.io.CharArrayWriter;
import java.io.IOException;
diff --git a/tika-langdetect/src/main/resources/META-INF/services/org.apache.tika.language.detect.LanguageDetector b/tika-langdetect/tika-langdetect-optimaize/src/main/resources/META-INF/services/org.apache.tika.language.detect.LanguageDetector
similarity index 93%
rename from tika-langdetect/src/main/resources/META-INF/services/org.apache.tika.language.detect.LanguageDetector
rename to tika-langdetect/tika-langdetect-optimaize/src/main/resources/META-INF/services/org.apache.tika.language.detect.LanguageDetector
index 79fc24e..e439510 100644
--- a/tika-langdetect/src/main/resources/META-INF/services/org.apache.tika.language.detect.LanguageDetector
+++ b/tika-langdetect/tika-langdetect-optimaize/src/main/resources/META-INF/services/org.apache.tika.language.detect.LanguageDetector
@@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-org.apache.tika.langdetect.OptimaizeLangDetector
+org.apache.tika.langdetect.optimaize.OptimaizeLangDetector
\ No newline at end of file
diff --git a/tika-langdetect/src/test/java/org/apache/tika/langdetect/OptimaizeLangDetectorTest.java b/tika-langdetect/tika-langdetect-optimaize/src/test/java/org/apache/tika/langdetect/optimaize/OptimaizeLangDetectorTest.java
similarity index 98%
rename from tika-langdetect/src/test/java/org/apache/tika/langdetect/OptimaizeLangDetectorTest.java
rename to tika-langdetect/tika-langdetect-optimaize/src/test/java/org/apache/tika/langdetect/optimaize/OptimaizeLangDetectorTest.java
index 59ed89d..cc92ee0 100644
--- a/tika-langdetect/src/test/java/org/apache/tika/langdetect/OptimaizeLangDetectorTest.java
+++ b/tika-langdetect/tika-langdetect-optimaize/src/test/java/org/apache/tika/langdetect/optimaize/OptimaizeLangDetectorTest.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.tika.langdetect;
+package org.apache.tika.langdetect.optimaize;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
@@ -29,6 +29,7 @@ import java.util.Locale;
import java.util.Map;
import org.apache.tika.io.IOUtils;
+import org.apache.tika.langdetect.LanguageDetectorTest;
import org.apache.tika.language.detect.LanguageConfidence;
import org.apache.tika.language.detect.LanguageDetector;
import org.apache.tika.language.detect.LanguageResult;
diff --git a/tika-langdetect/src/test/resources/org/apache/tika/langdetect/language-codes.txt b/tika-langdetect/tika-langdetect-optimaize/src/test/resources/org/apache/tika/langdetect/optimaize/language-codes.txt
similarity index 100%
rename from tika-langdetect/src/test/resources/org/apache/tika/langdetect/language-codes.txt
rename to tika-langdetect/tika-langdetect-optimaize/src/test/resources/org/apache/tika/langdetect/optimaize/language-codes.txt
diff --git a/tika-langdetect/src/test/resources/org/apache/tika/langdetect/udhr-known.txt b/tika-langdetect/tika-langdetect-optimaize/src/test/resources/org/apache/tika/langdetect/optimaize/udhr-known.txt
similarity index 100%
rename from tika-langdetect/src/test/resources/org/apache/tika/langdetect/udhr-known.txt
rename to tika-langdetect/tika-langdetect-optimaize/src/test/resources/org/apache/tika/langdetect/optimaize/udhr-known.txt
diff --git a/tika-langdetect/src/test/resources/org/apache/tika/langdetect/udhr-unknown.txt b/tika-langdetect/tika-langdetect-optimaize/src/test/resources/org/apache/tika/langdetect/optimaize/udhr-unknown.txt
similarity index 100%
rename from tika-langdetect/src/test/resources/org/apache/tika/langdetect/udhr-unknown.txt
rename to tika-langdetect/tika-langdetect-optimaize/src/test/resources/org/apache/tika/langdetect/optimaize/udhr-unknown.txt
diff --git a/tika-server/pom.xml b/tika-server/pom.xml
index 59404d4..dca3ed1 100644
--- a/tika-server/pom.xml
+++ b/tika-server/pom.xml
@@ -54,7 +54,7 @@
<dependency>
<groupId>${project.groupId}</groupId>
- <artifactId>tika-langdetect</artifactId>
+ <artifactId>tika-langdetect-optimaize</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
diff --git a/tika-server/src/main/java/org/apache/tika/server/resource/LanguageResource.java b/tika-server/src/main/java/org/apache/tika/server/resource/LanguageResource.java
index 7269ebb..537b1e6 100644
--- a/tika-server/src/main/java/org/apache/tika/server/resource/LanguageResource.java
+++ b/tika-server/src/main/java/org/apache/tika/server/resource/LanguageResource.java
@@ -29,7 +29,8 @@ import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import org.apache.commons.io.IOUtils;
-import org.apache.tika.langdetect.OptimaizeLangDetector;
+//TODO: don't hardcode optimaize
+import org.apache.tika.langdetect.optimaize.OptimaizeLangDetector;
import org.apache.tika.language.detect.LanguageResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/tika-server/src/main/java/org/apache/tika/server/resource/TranslateResource.java b/tika-server/src/main/java/org/apache/tika/server/resource/TranslateResource.java
index 0417077..bc10e59 100644
--- a/tika-server/src/main/java/org/apache/tika/server/resource/TranslateResource.java
+++ b/tika-server/src/main/java/org/apache/tika/server/resource/TranslateResource.java
@@ -36,7 +36,7 @@ import org.apache.commons.io.IOUtils;
import org.apache.tika.config.LoadErrorHandler;
import org.apache.tika.config.ServiceLoader;
import org.apache.tika.exception.TikaException;
-import org.apache.tika.langdetect.OptimaizeLangDetector;
+import org.apache.tika.langdetect.optimaize.OptimaizeLangDetector;
import org.apache.tika.language.detect.LanguageResult;
import org.apache.tika.language.translate.Translator;
import org.apache.tika.server.ServerStatus;
diff --git a/tika-translate/pom.xml b/tika-translate/pom.xml
index 7cc8bf5..bcce5cd 100644
--- a/tika-translate/pom.xml
+++ b/tika-translate/pom.xml
@@ -42,7 +42,7 @@
</dependency>
<dependency>
<groupId>org.apache.tika</groupId>
- <artifactId>tika-langdetect</artifactId>
+ <artifactId>tika-langdetect-optimaize</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
@@ -62,6 +62,30 @@
<artifactId>json-simple</artifactId>
<version>${json.simple.version}</version>
</dependency>
+ <!-- for java 10
+ See TIKA-2778 for why we need to do this now.
+ May the gods of dependency management fix this in the future.
+ -->
+ <dependency>
+ <groupId>org.glassfish.jaxb</groupId>
+ <artifactId>jaxb-runtime</artifactId>
+ <version>${jaxb.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-rs-client</artifactId>
+ <version>${cxf.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.glassfish.jaxb</groupId>
+ <artifactId>jaxb-runtime</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>jakarta.xml.bind</groupId>
+ <artifactId>jakarta.xml.bind-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxrs</artifactId>
diff --git a/tika-translate/src/main/java/org/apache/tika/language/translate/AbstractTranslator.java b/tika-translate/src/main/java/org/apache/tika/language/translate/AbstractTranslator.java
index 2a331bb..da250cf 100644
--- a/tika-translate/src/main/java/org/apache/tika/language/translate/AbstractTranslator.java
+++ b/tika-translate/src/main/java/org/apache/tika/language/translate/AbstractTranslator.java
@@ -18,7 +18,7 @@ package org.apache.tika.language.translate;
import java.io.IOException;
-import org.apache.tika.langdetect.OptimaizeLangDetector;
+import org.apache.tika.langdetect.optimaize.OptimaizeLangDetector;
import org.apache.tika.language.detect.LanguageDetector;
import org.apache.tika.language.detect.LanguageResult;