Skip to content

Instantly share code, notes, and snippets.

@Digo
Last active December 16, 2015 13:59
Show Gist options
  • Save Digo/5445968 to your computer and use it in GitHub Desktop.
Save Digo/5445968 to your computer and use it in GitHub Desktop.
ConnectionOptions connOptions = new ConnectionOptions();
connOptions.setCorpusUrl(ldcServerUrl);
connOptions.setCachingStrategy(mysqlCachingStrategy);
//Connects to a remote corpus server
AnnotatedCorpus aRemoteCorpus = CorpusManager.connect(connOptions);
//Query remote corpus and return a new corpus object
AnnotatedCorpus hitlistCorpus = aRemoteCorpus.subCorpus(keytermQuery);
myViewOptions.setDocumentContentShown();
myViewOptions.setAnnotationShown();
DocumentStreamReader reader = hitlistCorpus.getDocumentStreamReader(myViewOptions);
while(reader.hasNext()){
AnnotatedDocument doc = reader.next();
//do thing with doc
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment