* Example application doing actor based Slab processing.
*/
object AnalysisEngine {
case class ProcessCorpus(corpus: Iterator[String])
import AnalysisComponent._
import Span._
import Slab.StringSlab
val text1 = "Here is an example text. It has four sentences and it mentions Jimi Hendrix and Austin, Texas! In this third sentence, it also brings up Led Zeppelin and Radiohead, but does it ask a question? It also has a straggler sentence that doesn't end with punctuation"
val text2 = "How much wood can a woodchuck chuck? Can a woodchuck chuck wood?"
val text3 = "The Association for Computational Linguistics is proud to present its first Lifetime Achievement Award to Prof. Aravind Joshi of the University of Pennsylvania. Aravind Joshi was born in 1929 in Pune, India, where he completed his secondary education as well as his first degree in Mechanical and Electrical Engineering, the latter in 1950. He worked as a research assistant in Linguistics at Penn from 1958-60, while completing his Ph.D. in Electrical Engineering, in 1960. Joshi's work and the work of his Penn colleagues at the frontiers of Cognitive Science was rewarded in 1991 by the establishment of a National Science Foundation Science and Technology Center for Research in Cognitive Science, which Aravind Joshi co-directed until 2001. Dr. Joshi has supervised thirty-six Ph.D. theses to-date, on topics including information and coding theory, and also pure linguistics."
def main(args: Array[String]) {
val system = ActorSystem("ChalkSystem")
implicit val ec = system.dispatcher
implicit val timeout = Timeout(10 seconds)
val engine = system.actorOf(Props[AnalysisEngine])
val corpus = Iterator(text1,text2,text3)
for {
slabs <- (engine ? ProcessCorpus(corpus)).mapTo[Iterator[StringSlab[Sentence with Token]]]
slab <- slabs
} {
// Notice that the last sentence (lacking EOS char) is missing.