encoding of two filtering methods for alphabets