[296] When it is a woman (mātugāma), and he perceives her as a woman, and he lies down to sleep together with her, there is an offense entailing expiation (pācittiya). When it is a woman, and he is in doubt, and he lies down to sleep together with her, there is an offense entailing expiation. When it is a woman, and he perceives her as not a woman, and he lies down to sleep together with her, there is an offense entailing expiation.
In a place half-roofed or half-enclosed, there is an offense of wrongdoing (dukkaṭa). If he lies down to sleep together with a female yakkha (yakkhī), or a female peta (petī), or a paṇḍaka, or a female animal, there is an offense of wrongdoing.
When it is not a woman, and he perceives her as a woman, there is an offense of wrongdoing. When it is not a woman, and he is in doubt, there is an offense of wrongdoing. When it is not a woman, and he perceives her as not a woman, there is no offense (anāpatti).
English translation from the Pali (Siam Raṭṭha edition) — under review, not for citation.