A Computational Theory of Writing Systems (Studies in Natural Language Processing)