Text this: Optimal filtering