Skip to content

Instantly share code, notes, and snippets.

@renaud
Created March 4, 2014 08:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save renaud/9342376 to your computer and use it in GitHub Desktop.
Save renaud/9342376 to your computer and use it in GitHub Desktop.
Hello Ruta from whithin UIMAfit
package org.apache.uima.ruta.engine;
import static org.junit.Assert.assertEquals;
import java.util.Collection;
import org.apache.uima.fit.factory.JCasFactory;
import org.apache.uima.fit.util.JCasUtil;
import org.apache.uima.jcas.JCas;
import org.junit.Test;
public class Ruta101 {
@Test
public void testRuta() throws Exception {
JCas jCas = JCasFactory.createJCas(myTypeSystem);
jCas.setDocumentText("hello world");
Ruta.apply(jCas.getCas(), "\"hello\"-> Token;");
Collection<Token> tokens = JCasUtil.select(jCas, Token.class);
assertEquals(1, tokens.size());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment