[Question]
  [
So you want to create a haiku, but you're not sure if it follows the syllable rules for a haiku.
I couldn't be bothered to write a proper blurb like I usually do, so you'll have to make do with this. Let's get stuck right in.
## Finding a haiku out in the wild
For the purposes of this challenge, we will be checking if the given poem satisfies these criteria:
* There are three lines.
* The first line has 5 syllables.
* The second line has 7 syllables.
* The third line has 5 syllables.
Each line is composed of one or more words, separated by groups of spaces. These words are not necessarily valid English words.
Each word is split up into syllables, and then those syllables are counted to get the total syllable count of the line.
A syllable has either 2 or 3 parts to it: the beginning, the end, and possibly the middle. Each part is either a group of consonsants (also known as a consonant cluster, such as `s`, `sk` or `spl`) or a group of vowels (such as `i`, `ea` or `oui`).
If the beginning is a group of consonants, the middle will be a group of vowels and the end will be a group of consonants. If the beginning is a group of vowels, the end will be a group of consonants and there will be no middle.
For example, the word `example` is made up of three syllables, `ex`, `am` and `ple`. `ple` has no ending as it was cut short by the end of the word.
As another example, the word `syllable` also has three syllables, `syll`, `abl` and `e`, which also has no ending.
For one final example, the word `word` has one syllable, `word`, which ends with a group of consonants.
## The challenge
Given a string, list of strings, list of lists or any other [reasonable format](https://codegolf.meta.stackexchange.com/questions/2447/default-for-code-golf-input-output-methods) representing a poem with at least one line, determine if it meets the criteria of a haiku outlined above and return the result.
You may return the result in any of these formats:
* A truthy value if the poem is a haiku and a falsy one otherwise.
* A falsy value if the poem is a haiku and a truthy one otherwise.
* A value from a finite range of values specified in the submission if the poem is a haiku and a value from a mutually exclusive finite range of values also specified in the submission.
You may also assume the poem contains no non-alphabetical characters, but you may not assume that it is entirely in uppercase or lowercase.
For the purposes of this challenge, `Y` is a vowel.
## Test cases
### Truthy
```
This is a haiku
Yes it truly is one
See what I did man
```
---
```
I am so tired
of writing this already
when can I stop this
```
---
```
Writing another
Of these horrific things
Come on please
```
---
```
Consonant only
Counts as one syllable
ghjk tgh knmb wrts vbc
```
### Falsy
```
oh boy writing non haiku is so much easier
```
---
```
This is
so good
on my
poor dear brain
```
---
```
The syllables do not match
at least I do not think so
I have not checked
```
---
```
It does not really matter
these test cases will help
At least I think they will
```
---
```
I am done here
This is enough
Goodbye
```
## Scoring
Since this is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'")  
The shortest answer will win  
Good luck to you all
  
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~25~~ 23 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
-2 thanks to Erik the Outgolfer (use a list of lines as input)
```
e€Øy0;ŒgP€
ḲLÐfÇ€ḣ8µ€ḣ4
```
A monadic link taking a list of lists of characters (the lines) and returning a list of lists of lists of zeros and ones. Valid haiku will be length 3 and once any of the deepest lists that are a single zero are replaced by a single one the sum of the flattened lists will be 5, 7, and 5 respectively. The formation (whether *runs* of letters are consonants and only taking the first 8 words of each of up to only 4 lines) ensures there are only finite of each of the valid and invalid ranges.
**[Try it online!](https://tio.run/##y0rNyan8/z/1UdOawzMqDayPTkoPALK5Hu7Y5HN4QtrhdiDn4Y7FFoe2Qhgm////j1YKycgsVgACCJkIIjISM7NLgUwUqKTDpaAUmQpSlVkCJEqKSnMqFRQQWhXy81LBipwV4KA8I7EEyvSEC6ZkpsDZuYl5SrEA "Jelly – Try It Online")** or see the (even more confusing!) [test-suite](https://tio.run/##RVGxSgNBFOzzFY/DMoKFhWAlFhIQFBTCESw2dy@3a/Z2w96e4VqbtJIqva2VIESwMuRD4o@cs3vRwHHsvpmdN2/eI2vdtC3/PL9tVs3J@XZZ3OLc263frzcvk80Cl9369ez7ozuctpvFdrn7XA1726@IHqUp/mnbjpJ7qSrCJ0gKNa2TfpIyCp68q3UTEGsY1TtmmkvhaUC5yqkUJnnoj5IBiZIqS145zkG7mdDcKa9MQT4oC@1Y5A2QoWRDmTAQqLydRThKDPd8YayX7DoRnComaZ1TE5UFsikqQJe2ZDiimWZRcXxvJY1t89/WWHMcRwne4aysM0kgK0gH@n5gaAEsrA2uIVgGjzNrHeUsHI2dUGbPZ6oarcVYI5jcooHH@D6TeIA8gpGYSocEp1P0BThApE8cq5nkbIqAYmQeXEiFOsLBLoOcj5N3Y3uGYob5KporrUmyngG8ODTruoDdRMZhFTm2Bb4LK/tbLRtbF8HtFaYdN0jtFw "Jelly – Try It Online")
---
Here is a much easier to use **~~32~~ 30 byte** version, simply outputting 1 or 0:
```
e€Øy0;ŒgP€SȯL$
ḲLÐfÇ€Sµ€⁼5,7,5
```
[Try this one](https://tio.run/##y0rNyan8/z/1UdOawzMqDayPTkoPALKDT6z3UeF6uGOTz@EJaYfbQSKHtgLJR417THXMdUz///8frRSSkVmsAAQQMhFEZCRmZpcq6XApKEWmgkQzS4BESVFpTqWCAkKpQn5eKliRswIclGcklkCZnnDBlMwUODs3MU8pFgA "Jelly – Try It Online") or see its [test-suite](https://tio.run/##RVHBSgMxFLz7FY@lxwpeigdP4kEKBYUKpRQP6e7rJjablGxq2aNeepWe@hGCIAgKPVkK/kb7I@skrRZCCG8m8@bNe2Ctq7rm3fPrelmdXWwW@S3e3Z@3TuNk@/neWb@M1vNQ@f7AvXtatZrnzVa9nm8W269l72SzinCj38fdr@tBcidVSTiCpFDjadJM@oyCJ@@mugqINYxql5lmUnhqU6YyKoRJ7puDpE2ioNKSV44z0G5GNHPKK5OTD8pCOxZZBaQn2VAqDARKbycRjhK9A18Y6yW7vQheJZO0zqmRSgPZ5CWgK1swHNFEsyg5/reShrb6b2usOY2jBO9wVkxTSSArSAf6YWBoAcytDa4hWASPE2sdZSwcDZ1Q5sBnKiutxVAjmMyigcf4PpX4gDyCkZjKHglOx@gLsI1IHzlWU8npGAHFyDy4kAp1hIONBjkfJ9@P7RmKKeYraaa0Jsl6AvDy2GzfBewqMo6ryLAt8F1Y2d9q2dhpHtxeY9phhdR@AQ "Jelly – Try It Online").
[Answer]
# JavaScript (ES6), ~~84~~ 75 bytes
Takes input as a list of lists of words. Returns `true` for haiku or `false` for non-haiku.
```
a=>a.map(s=>(s.map(w=>w.match(/[aeiouy]+/gi))+'').split`,`.length)=='5,7,5'
```
### Test cases
```
let f =
a=>a.map(s=>(s.map(w=>w.match(/[aeiouy]+/gi))+'').split`,`.length)=='5,7,5'
console.log('[Truthy]');
console.log(f([
  ["This","is","a","haiku"],
  ["Yes","it","truly","is","one"],
  ["See","what","I","did","man"]
]));
console.log(f([
  ["I","am","so","tired"],
  ["of","writing","this","already"],
  ["when","can","I","stop","this"]
]));
console.log(f([
  ["Writing","another"],
  ["Of","these","horrific","things"],
  ["Come","on","please"]
]));
console.log(f([
  ["Consonant","only"],
  ["Counts","as","one","syllable"],
  ["ghjk","tgh","knmb","wrts","vbc"]
]));
console.log('[Falsy]');
console.log(f([
  ["oh","boy","writing","non","haiku","is","so","much","easier"]
]));
console.log(f([
  ["This","is"],
  ["so","good"],
  ["on","my"],
  ["poor","dear","brain"]
]));
console.log(f([
  ["The","syllables","do","not","match"],
  ["at","least","I","do","not","think","so"],
  ["I","have","not","checked"]
]));
console.log(f([
  ["It","does","not","really","matter"],
  ["these","test","cases","will","help"],
  ["At","least","I","think","they","will"]
]));
console.log(f([
  ["I","am","done","here"],
  ["This","is","enough"],
  ["Goodbye"]
]));
```
[Answer]
# [Retina](https://github.com/m-ender/retina), 49 bytes
```
i`[aeiouy]+
1
T`lL`2
2*12+
3
[12]+
3
%M`3
^5¶7¶5$
```
[Try it online!](https://tio.run/##K0otycxL/P8/MyE6MTUzv7QyVpvLkCskIccnwYjLSMvQSJvLmCva0CgWRKv6JhhzxZke2mZ@aJupyv//IRmZxQpAlKiQkZiZXcoVmQrkliiUFJXmVILE8/NSuYJTUxXKMxJLFDwVUjJTFHIT8wA "Retina – Try It Online")
Outputs `1` for haiku,`0` for non-haiku.
[Answer]
# [Python 2](https://docs.python.org/2/), ~~126~~ ~~125~~ ~~120~~ 121 bytes
```
lambda s:[len(split('\s+',sub('[aeiouy][^aeiouy ]+','X ',t,0,I).strip()))for t in s.split('\n')]==[5,7,5]
from re import*
```
[Try it online!](https://tio.run/##ZZFRa9wwDICf51@hNydbVsagDAr3MAot97SHFrpxvYITK2dzjhVsZVl@/U1JrtuVQiCOZH2SvvQTO4pfT@3m@RRMV1sD@WYXMBa5D54L/Zw/6SoPdaF3Bj0N0373sh5gLxn9E3TF1ZdqW15lTr4vyrJsKQGDj5CvXilRl/vNZnddfauu96pN1EFC8F1PiT@eLLZwV@TyRn3ok48M@fXQSvR8Vuqu0Fo/Op9Bnj/gjD8O6hfKJwOnIUxznCKqB0QYnWHYgvUWOhOlsDwDtmA6yATsE1r1o4UxefbxADyTTUho7KSeHEZoTBREZuqX5AXk6VxjIrHDNGPknREcpeRb38wF8ZDVLXUoM0Ef0GS8IJCDmqZ/zSPFz8tC8w4yXTc0DqTEY7ooOi@v5MKByCoBd5PqSYRbNAnqZHx8cx8hTyGYOogmS9KGRQc3TomdeaTF0RqfJz5Kb7UVtb9xiTUOmyPaS30s9wU2Z0VVEOsCZHGwCmAUZiO7Zhh9COAw9Or7/2ZrF7k7Lfn3y0FDVpIHCq1a5helC9TEPGJaqaOP6l4MQBgaoRFMNMi/W3Gnvw "Python 2 – Try It Online")
[Answer]
# [Perl 5](https://www.perl.org/), 63 + 1 (`-p`) = 64 bytes
```
$a[$.]=()=/([aeiouy]+|\b[^aeiouy ]+\b)\s*/ig}{$\="@a"eq" 5 7 5"
```
[Try it online!](https://tio.run/##Jci9CsIwFEDhvU9xCRlaS38cglPA1cFJF2kq3NKLDdYmNilS1Fc3VoSzfMfS2IsQOFY8r2WcyCKukLSZ5jp9qaY6/wF1qppEuVWhL@8nV5JtkdGdgYANCBbCsdMOlhA61NcpOtFCD36c@vn3zUDRgQgeHXrYQatbuOHwMdZrM7iQ7UVersuQ2S8 "Perl 5 – Try It Online")
[Answer]
# [Clean](https://clean.cs.ru.nl), ~~162~~ ... 115 bytes
```
import StdEnv,StdLib
@t=[sum[max(sum(map hd(group[sum[1\\v<-:"AaEeIiOoUuYy"|c==v]\\c<-w])))1\\w<-l]\\l<-t]==[5,7,5]
```
Defines the function `@`, taking `[[[Char]]]` (list of list of words), and giving `Bool`.  
Returns `True` when the input is a haiku, `False` otherwise.
[Try it online!](https://tio.run/##LY8/a8MwFMT3fAqRxTZYQ4ZQKBaktBkCgQ6hQ5E1PMuqo0R/jCXbNfSzV1UVT797d/eG40qACdq2oxJIgzRB6t4OHl18ezRTGXGWzebgCXWjphq@88hcQ4@ubd4NduxTsKvrqcLP2xc4ipN8tx/j57L94YRMrK55hWdWFEUszRVW0VEV9owQui@fyj0LFw@D3xB0QJTS7NUaZw0Yn7GSZtaoJWNR/Qej8S654NZQJLpFKWiUWIvd9XZPvu8S7kY3SczD@j81PHZZ@OVfCjoX8Okc3hYDWvLH8Rj@Bw "Clean – Try It Online")
[Answer]
## Mathematica 119 Bytes
Here is a version that conforms to the given rules for syllables:
```
Tr/@Map[Length@StringCases[#,("a"|"e"|"i"|"o"|"u"|"y")..]/. 0->1&,(s=StringSplit)/@s[ToLowerCase@#,"\n"],{2}]=={5,7,5}&
```
Here is an 83 byte version that actually counts syllables:
```
Tr/@Map[Length@WordData[#,"Hyphenation"]&,(s=StringSplit)/@s[#,"\n"],{2}]=={5,7,5}&
```
e.g.
```
%@"This is a haiku
Yes it truly is one
See what I did man"
```
returns `False` since the second line has six syllables rather than the required seven.
]