You're correct, in that case I think the only way to do it is the current approach. Thanks!

On Jul 22, 2013, at 10:39 AM, bethard <notifications@github.com> wrote:

> In src/main/scala/chalk/slab/AnalysisFunction.scala:
> 
> > @@ -19,30 +19,41 @@ object StringIdentityAnalyzer extends AnalysisFunction[String, StringAnnotation,
> >  /**
> >    * A simple regex sentence segmenter.
> >    */
> > -trait SentenceSegmenter extends AnalysisFunction[String, StringAnnotation, StringAnnotation, Sentence] {
> > -  def apply(slab: Slab[String, StringAnnotation, StringAnnotation]) =
> > -    slab ++ "[^\\s.!?]+[^.!?]+[.!?]".r.findAllMatchIn(slab.content).map(m => Sentence(m.start, m.end))
> > +trait SentenceSegmenter[I <: StringAnnotation] extends AnalysisFunction[String, StringAnnotation, I, Sentence] {
> I like the readability in your proposal, but I think we'd lose the ability to use a regular Function1 as an analyzer, no? How would you write trait AnalysisFunction[C,B,I<:B,O<:B] extends (Slab[C,B,I] => Slab[C,B,B with I with O]) in your proposal?
> 
> —
> Reply to this email directly or view it on GitHub.