Text search algorithm implemented with Scala .