A Common framework to recognize two-dimensional languages