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

Chris A. Mattmann commented on TIKA-1623:
-----------------------------------------

MicrosoftTranslator works great:

{noformat}
curl -X PUT --data-binary @sentences 
http://localhost:9998/translate/all/org.apache.tika.language.translate.MicrosoftTranslator/es/en
I need practice in Spanish
{noformat}

To leverage:

#. create a conf/org/apache/tika/language/translate folder
#. create a translator.microsoft.properties file inside of that folder
{noformat}
translator.client-id=dummy-id
translator.client-secret=dummy-secret
{noformat}
#. java -classpath ./conf:target/tika-server-1.9-SNAPSHOT.jar 
org.apache.tika.server.TikaServerCl 

Output will look like:
{noformat}
[chipotle:~/src/tika-server] mattmann% java -classpath 
.:target/tika-server-1.9-SNAPSHOT.jar org.apache.tika.server.TikaServerCli
May 06, 2015 5:14:41 PM org.apache.tika.server.TikaServerCli main
INFO: Starting Apache Tika 1.9-SNAPSHOT server
May 06, 2015 5:14:41 PM org.apache.cxf.endpoint.ServerImpl initDestination
INFO: Setting the server's publish address to be http://localhost:9998/
May 06, 2015 5:14:41 PM org.slf4j.impl.JCLLoggerAdapter info
INFO: jetty-8.y.z-SNAPSHOT
May 06, 2015 5:14:41 PM org.slf4j.impl.JCLLoggerAdapter info
INFO: Started SelectChannelConnector@localhost:9998
May 06, 2015 5:14:41 PM org.apache.tika.server.TikaServerCli main
INFO: Started
May 06, 2015 5:14:45 PM org.apache.tika.server.resource.TranslateResource 
doTranslate
INFO: Using translator: 
[org.apache.tika.language.translate.MicrosoftTranslator]: src: [es]: dest: [en]
{noformat}

Going to test the Google one and if good, will commit.


> Expose Translation Interface from Tika Server
> ---------------------------------------------
>
>                 Key: TIKA-1623
>                 URL: https://issues.apache.org/jira/browse/TIKA-1623
>             Project: Tika
>          Issue Type: Bug
>          Components: server, translation
>            Reporter: Chris A. Mattmann
>            Assignee: Chris A. Mattmann
>             Fix For: 1.9
>
>         Attachments: TIKA-1623.Mattmann.050615.patch.txt
>
>
> Tika Server should expose the Tika Translate API. This will allow for easy 
> use in downstream clients such as 
> [Tika-Python|http://github.com/chrismattmann/tika-python]



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to