def test_hapax_legomenon( self ): ideal = [ 'and', 'valleys', 'over', 'it', 'greenest', 'seraph', 'our', 'its', 'stood', 'stately', 'there', 'spread', 'monarch', 'angels', 'head', 'good', 'never', 'half', 'by', 'fabric', 'a', 'reared', 'of', 'radiant', 'tenanted', 'thought', 's', 'so', 'dominion', 'pinion', 'once' ] hapax_legomenons = exercises.find_hapax_legomenons( 'data/usher.md' ) self.assertEqual( set(ideal), hapax_legomenons )
def test_hapax_legomenon( self ): ideal = [ 'and', 'valleys', 'over', 'it', 'greenest', 'seraph', 'our', 'its', 'stood', 'stately', 'there', 'spread', 'monarch', 'angels', 'head', 'good', 'never', 'half', 'by', 'fabric', 'a', 'reared', 'of', 'radiant', 'tenanted', 'thought', 's', 'so', 'dominion', 'pinion', 'once' ] hapax_legomenons = exercises.find_hapax_legomenons( 'data/usher.md' ) self.assertEqual( ideal, hapax_legomenons )