change build-approx-patterns
add test for build-approx-patterns