Skip to content

house: Inconsistent expected output with other recitation-related exercises #1200

Closed
@mrcfps

Description

@mrcfps

Currently there are four exercises related with reciting verses: beer-song, food-chain, house, and twelve-days.

Testing a single verse

In beer-song:

"expected": [
  "99 bottles of beer on the wall, 99 bottles of beer.",
  "Take one down and pass it around, 98 bottles of beer on the wall."
]

In food-chain:

"expected": [
  "I know an old lady who swallowed a spider.",
  "It wriggled and jiggled and tickled inside her.",
  "She swallowed the spider to catch the fly.",
  "I don't know why she swallowed the fly. Perhaps she'll die."
]

In twelve-days:

"expected": [
  "On the first day of Christmas my true love gave to me, a Partridge in a Pear Tree."
]

But in house, a single sentence is separated into multiple strings:

"expected": [
  "This is the dog",
  "that worried the cat",
  "that killed the rat",
  "that ate the malt",
  "that lay in the house that Jack built."
]

Testing multiple verses

In beer-song, verses are separated by an empty string:

"expected": [
  "2 bottles of beer on the wall, 2 bottles of beer.",
  "Take one down and pass it around, 1 bottle of beer on the wall.",
  "",
  "1 bottle of beer on the wall, 1 bottle of beer.",
  "Take it down and pass it around, no more bottles of beer on the wall.",
  "",
  "No more bottles of beer on the wall, no more bottles of beer.",
  "Go to the store and buy some more, 99 bottles of beer on the wall."
]

And it's the same case in food-chain:

"expected": [
  "I know an old lady who swallowed a fly.",
  "I don't know why she swallowed the fly. Perhaps she'll die.",
  "",
  "I know an old lady who swallowed a spider.",
  "It wriggled and jiggled and tickled inside her.",
  "She swallowed the spider to catch the fly.",
  "I don't know why she swallowed the fly. Perhaps she'll die.",
  "",
  "I know an old lady who swallowed a bird.",
  "How absurd to swallow a bird!",
  "She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.",
  "She swallowed the spider to catch the fly.",
  "I don't know why she swallowed the fly. Perhaps she'll die."
]

So is house:

"expected": [
  "This is the cat",
  "that killed the rat",
  "that ate the malt",
  "that lay in the house that Jack built.",
  "",
  "This is the dog",
  "that worried the cat",
  "that killed the rat",
  "that ate the malt",
  "that lay in the house that Jack built.",
  "",
  "This is the cow with the crumpled horn",
  "that tossed the dog",
  "that worried the cat",
  "that killed the rat",
  "that ate the malt",
  "that lay in the house that Jack built."
]

But in twelve-days, there are no separating empty strings:

"expected": [
  "On the fourth day of Christmas my true love gave to me, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.",
  "On the fifth day of Christmas my true love gave to me, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.",
  "On the sixth day of Christmas my true love gave to me, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree."
]

My suggestion

Since each verse in both house and twelve-days is a single long sentence (contrarily beer-song and food-chain have multiple sentences in their verses), I would suggest transforming house's output to the same format as twelve-day's, because IMO separating a single sentence into multiple pieces is not a natural choice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions