public static void registerFactory() { StreamFactoryRegistry.registerFactory(TokenSample.class, "ad", new ADTokenSampleStreamFactory(Parameters.class)); }
@Before public void setup() throws IOException, URISyntaxException { ADTokenSampleStreamFactory factory = new ADTokenSampleStreamFactory( ADTokenSampleStreamFactory.Parameters.class); File dict = new File(getClass().getClassLoader() .getResource("opennlp/tools/tokenize/latin-detokenizer.xml").toURI()); File data = new File(getClass().getClassLoader() .getResource("opennlp/tools/formats/ad.sample").toURI()); String[] args = { "-data", data.getCanonicalPath(), "-encoding", "UTF-8", "-lang", "por", "-detokenizer", dict.getCanonicalPath() }; ObjectStream<TokenSample> tokenSampleStream = factory.create(args); TokenSample sample = tokenSampleStream.read(); while (sample != null) { samples.add(sample); sample = tokenSampleStream.read(); } }
public static void registerFactory() { StreamFactoryRegistry.registerFactory(TokenSample.class, "ad", new ADTokenSampleStreamFactory(Parameters.class)); }
public static void registerFactory() { StreamFactoryRegistry.registerFactory(TokenSample.class, "ad", new ADTokenSampleStreamFactory(Parameters.class)); }
public static void main(String[] a) throws Exception { ADTokenSampleStreamFactory factory = new ADTokenSampleStreamFactory( ADTokenSampleStreamFactory.Parameters.class);
public static void main(String[] a) throws Exception { ADTokenSampleStreamFactory factory = new ADTokenSampleStreamFactory( ADTokenSampleStreamFactory.Parameters.class);