added maxlength to building pattern model on test corpus