Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@egonw
Created October 26, 2010 15:02
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 egonw/647057 to your computer and use it in GitHub Desktop.
Save egonw/647057 to your computer and use it in GitHub Desktop.
@Test public Oscar testConstructor() throws URISyntaxException {
Oscar oscar = new Oscar();
Assert.assertNotNull(oscar);
return oscar;
}
@Given("#testConstructor")
public String testNormalize(Oscar oscar) throws URISyntaxException {
String input = oscar.normalize("This is a simple input string with benzene.");
Assert.assertNotNull(input);
return input;
}
@Given("#testConstructor,#testNormalize")
public List<TokenSequence> testTokenize(Oscar oscar, String input) throws Exception {
List<TokenSequence> tokens = oscar.tokenize(input);
Assert.assertNotNull(tokens);
Assert.assertNotSame(0, tokens.size());
return tokens;
}
@Given("#testConstructor,#testTokenize")
public void testRecognizeNamedEntities(Oscar oscar, List<TokenSequence> tokens) throws Exception {
List<NamedEntity> entities = oscar.recognizeNamedEntities(tokens);
Assert.assertNotNull(entities);
Assert.assertEquals(1, entities.size());
System.out.println(""+ entities.get(0));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment