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 <[email protected]> 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 <[email protected]> > 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 > >
