Theory of computing text as categories