Re: programmatic API usage?
Here is an example of how to run it, in TIKA-1343 programmatically: https://issues.apache.org/jira/browse/TIKA-1343 this patch: https://reviews.apache.org/r/22761/ ++ Chris Mattmann, Ph.D. Chief Architect Instrument Software and Science Data Systems Section (398) NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA Office: 168-519, Mailstop: 168-527 Email: chris.a.mattm...@nasa.gov WWW: http://sunset.usc.edu/~mattmann/ ++ Director, Information Retrieval and Data Science Group (IRDS) Adjunct Associate Professor, Computer Science Department University of Southern California, Los Angeles, CA 90089 USA WWW: http://irds.usc.edu/ ++ On 4/12/16, 8:33 AM, "Tommaso Teofili"wrote: >thanks Matt for the reply. > >What I could come up so far is the following: >String configFile = "/path/to/config"; >JoshuaConfiguration joshuaConfiguration = new JoshuaConfiguration(); > >joshuaConfiguration.readConfigFile(configFile); >Decoder decoder = new Decoder(joshuaConfiguration, configFile); >ByteArrayOutputStream os = new ByteArrayOutputStream(); >decoder.decodeAll(new TranslationRequestStream(new BufferedReader(new >StringReader(textToTranslate)), joshuaConfiguration), os); >os.flush(); >byte[] bytes = os.toByteArray(); >String translationOutput = IOUtils.toString(bytes, >Charset.defaultCharset().name()); > > >I think it'd be good if we could support such a usage, I'll keep >experimenting. > >Regards, >Tommaso > > > >Il giorno mar 12 apr 2016 alle ore 17:09 Matt Post ha >scritto: > >> Hi Tommaso, >> >> There isn't really, unfortunately. I have never used Joshua as a library; >> it would be nice if the Amazon folks (who I infer have done so, from a >> comment on their last commit) would contribute a doc on this front. >> >> What is the preferred avenue for developer documentation? Javadocs, or >> something else? >> >> matt >> >> >> > On Apr 12, 2016, at 6:09 AM, Tommaso Teofili >> wrote: >> > >> > Hi all, >> > >> > I am going through the code (so I'll probably figure it out at some >> point), >> > however I wonder if there's a quick guide on how to start using Joshua >> > programmatically as I am start having a look at how it could be >> integrated >> > into other projects. >> > >> > Regards, >> > Tommaso >> >>
Re: programmatic API usage?
thanks Matt for the reply. What I could come up so far is the following: String configFile = "/path/to/config"; JoshuaConfiguration joshuaConfiguration = new JoshuaConfiguration(); joshuaConfiguration.readConfigFile(configFile); Decoder decoder = new Decoder(joshuaConfiguration, configFile); ByteArrayOutputStream os = new ByteArrayOutputStream(); decoder.decodeAll(new TranslationRequestStream(new BufferedReader(new StringReader(textToTranslate)), joshuaConfiguration), os); os.flush(); byte[] bytes = os.toByteArray(); String translationOutput = IOUtils.toString(bytes, Charset.defaultCharset().name()); I think it'd be good if we could support such a usage, I'll keep experimenting. Regards, Tommaso Il giorno mar 12 apr 2016 alle ore 17:09 Matt Postha scritto: > Hi Tommaso, > > There isn't really, unfortunately. I have never used Joshua as a library; > it would be nice if the Amazon folks (who I infer have done so, from a > comment on their last commit) would contribute a doc on this front. > > What is the preferred avenue for developer documentation? Javadocs, or > something else? > > matt > > > > On Apr 12, 2016, at 6:09 AM, Tommaso Teofili > wrote: > > > > Hi all, > > > > I am going through the code (so I'll probably figure it out at some > point), > > however I wonder if there's a quick guide on how to start using Joshua > > programmatically as I am start having a look at how it could be > integrated > > into other projects. > > > > Regards, > > Tommaso > >
Re: Release Cycle for Joshua
May 1 is going to be hard for me. I'd like to advocate for quarterly releases with a June 1 first release. Would that be okay? > On Apr 12, 2016, at 1:31 AM, Lewis John Mcgibbney> wrote: > > Cool. > I've got the 1st Incubating release provisionally down for 1st May. It > would be dynamite if we could get an RC ready for then. > > > On Mon, Apr 11, 2016 at 10:13 PM, Tommaso Teofili > wrote: > >> +1 for a (not too strict) scheduled cycle, 2 months pace sounds appropriate >> for starting. >> >> Regards, >> Tommaso >> >> Il giorno lun 11 apr 2016 alle ore 19:51 Lewis John Mcgibbney < >> lewis.mcgibb...@gmail.com> ha scritto: >> >>> Hi Folks, >>> Any interested in setting a release cycle for Joshua e.g. every two >> months, >>> quarterly? >>> Would be nice to get consensus on this and even maybe make our first >>> release prior to ApacheCon coming up. >>> Thanks >>> Lewis >>> >>> -- >>> *Lewis* >>> >> > > > > -- > *Lewis*
Re: tests are not run using latest code
So you are building with Macen Tommaso? The Maven build is not functional. Instead if you build with Ant it does build the tests and then run them. Lewis On Tuesday, April 12, 2016, Tommaso Teofiliwrote: > Hi all, > > while having a look at [1], I have realized that current tests in Joshua do > not run against latest source code (I think), in fact the test compilation > fails (with Maven) if I just set the test directory. > I think that, besides the Ant vs Maven thing, it'd be really good if we > could use latest code when performing tests. > Or am I missing something ? > > Regards, > Tommaso > > [1] : https://issues.apache.org/jira/browse/JOSHUA-252 > -- *Lewis*
[jira] [Commented] (JOSHUA-252) Make it possible to use Maven to build Joshua
[ https://issues.apache.org/jira/browse/JOSHUA-252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15236966#comment-15236966 ] Hudson commented on JOSHUA-252: --- SUCCESS: Integrated in joshua_master #13 (See [https://builds.apache.org/job/joshua_master/13/]) JOSHUA-252 - fixed Maven compilation phase (tommaso: rev 9e48d125393fa53cd52b52bdbb480c97fd3a4aad) * pom.xml JOSHUA-252 - fixed groupId, set the version to snapshot (tommaso: rev 3c9984d59b646cdb86d8325608245d9e2ee12216) * pom.xml JOSHUA-252 - upgraded snapshot version as it looks 6.0.5 has been (tommaso: rev 044a4e69513e30c3e1be6c9988958506d4afa996) * pom.xml > Make it possible to use Maven to build Joshua > - > > Key: JOSHUA-252 > URL: https://issues.apache.org/jira/browse/JOSHUA-252 > Project: Joshua > Issue Type: Improvement >Reporter: Tommaso Teofili >Assignee: Tommaso Teofili > Fix For: 6.1 > > > As per discussion on the dev@ list for now Ant is the official build tool for > Joshua however we would like to possibly switch to Maven if / when someone is > able to do so. > Assigning to me for now as I could be able to look into this. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
programmatic API usage?
Hi all, I am going through the code (so I'll probably figure it out at some point), however I wonder if there's a quick guide on how to start using Joshua programmatically as I am start having a look at how it could be integrated into other projects. Regards, Tommaso
[jira] [Created] (JOSHUA-252) Make it possible to use Maven to build Joshua
Tommaso Teofili created JOSHUA-252: -- Summary: Make it possible to use Maven to build Joshua Key: JOSHUA-252 URL: https://issues.apache.org/jira/browse/JOSHUA-252 Project: Joshua Issue Type: Improvement Reporter: Tommaso Teofili Assignee: Tommaso Teofili Fix For: 6.1 As per discussion on the dev@ list for now Ant is the official build tool for Joshua however we would like to possibly switch to Maven if / when someone is able to do so. Assigning to me for now as I could be able to look into this. -- This message was sent by Atlassian JIRA (v6.3.4#6332)