The recognition of indifference digraphs and generalized semiorders