How are literary devices used in this passage from The Scarlet Letter?
Arthur Dimmesdale gazed into Hester's face with a look in which hope and joy shone out, indeed, but with fear betwixt them, and a kind of horror at her boldness, who had spoken what he vaguely hinted at, but dared not speak. But Hester Prynne, with a mind of native courage and activity, and for so long a period not merely estranged, but outlawed from society, had habituated herself to such latitude of speculation as was altogether foreign to the clergyman. She had wandered, without rule or guidance, in a moral wilderness, as vast, as intricate, and shadowy as the untamed forest, amid the gloom of which they were now holding a colloquy that was to decide their fate. Her intellect and heart had their home, as it were, in desert places, where she roamed as freely as the wild Indian in his woods. For years past she had looked from this estranged point of view at human institutions, and whatever priests or legislators had established; criticizing all with hardly more reverence than the Indian would feel for the clerical band, the judicial robe, the pillory, the gallows, the fireside, or the church. The tendency of her fate and fortunes had been to set her free. The scarlet letter was her passport into regions where other women dared not tread. Shame, Despair, Solitude! These had been her teachers--stern and wild ones--and they had made her strong, but taught her much amiss.
Metaphor: Hester wanders into a moral wilderness. There is no such thing. But the use of the word wilderness demonstrates a vast and empty place with no other people around. The author compares where she's at to this wilderness.
Her heart and mind are compared to the desert where she can roam free. This again demonstrates her separation from everyone else.
These two escapes (by being empty places) also suggest her disposition as void and barren.
Another metaphor occurs in the sentence which refers to the scarlet letter as a passport. This specific comparison is more directly labeled metonomy which is directly substituting one item for another.
Personification: Shame, despair, and solitude are given the human abilities to teach Hester. They are referred to as her "teachers" and are given the abilities to be stern and wild. They also make her strong, but teach her incorrectly. This device demonstrates the changes that have occured within Hester's psychological state.