[Haikus](https://en.wikipedia.org/wiki/Haiku_in_English) are short poems in a three-line format, with 17 syllables arranged in a 5–7–5 pattern. Your task is to check if the supplied text is a haiku or not.
### About syllables
[Syllables](https://en.wikipedia.org/wiki/Syllable) are the phonological building blocks of words. *In this kata*, a syllable is a part of a word including a vowel ("a-e-i-o-u-y") or a group of vowels (e.g. "ou", "ee", "ay"). A few examples: "tea", "can", "to·day", "week·end", "el·e·phant".
**However**, silent "E"s **do not** create syllables. *In this kata*, an "E" is considered silent if it's alone at the end of the word, preceded by one (or more) consonant(s) and there is at least one other syllable in the word. Examples: "age", "ar·range", "con·crete"; but not in "she", "blue", "de·gree".
Some more examples:
* one syllable words: "cat", "cool", "sprout", "like", "eye", "squeeze"
* two syllables words: "ac·count", "hon·est", "beau·ty", "a·live", "be·cause", "re·store"
## Examples
```
An old silent pond...
A frog jumps into the pond,
splash! Silence again.
```
...should return `True`, as this is a valid 5–7–5 haiku:
```
An old si·lent pond...            # 5 syllables
A frog jumps in·to the pond,      # 7
splash! Si·lence a·gain.          # 5
```
Another example:
```
Autumn moonlight -
a worm digs silently
into the chestnut.
```
...should return `False`, because the number of syllables per line is not correct:
```
Au·tumn moon·light -          # 4 syllables
a worm digs si·lent·ly        # 6
in·to the chest·nut.          # 5
```
---
## My other katas
If you enjoyed this kata then please try [my other katas](https://www.codewars.com/collections/katas-created-by-anter69)! :-)
import re, string
def is_haiku(text):
    text = text.translate(str.maketrans('', '', string.punctuation))
    text = text.lower().splitlines() # Convert text to lowercase and split by lines
    # Count as a syllable if consonant followed by vowel
    sylRegex = re.compile(r'[^aeiouy\s][aeiouy]') #consonant vowel
    syl2Regex = re.compile(r'''                 #for edge cases
    (ia[^lgn])|(riet)|
    (iu)|([^tn]io[^nr])|(ii)|
    ([aeiouym]bl$)|(aeiou){3}|(^mc)|(ism$)|
    (([^aeiouy])\1l$)|([^l]lien)|
    (^coa[dglx].)|([^gq]ua[^auieol])|(dnt$)''', re.VERBOSE)
    endsERegex = re.compile(r'[^aeiouy][aeiouy][aeiou]*[^e\s]+e(?:\s|$)') # -1 syllable if the word ends with "e"
    endsE2Regex = re.compile(r'^\b[ea]\w{1,2}e(?:\s|$)') # age, aide, edge
    beginVRegex = re.compile(r'\b[aeiouy]') # +1 syllable if the word begins with a vowel
    exceptions_add = re.compile(r'''(triangle)''') #based on random case failures
    exceptions_minus = re.compile(r'''(obvious)''')

# Counts for each line
    count = []
    for i in range(len(text)):
        syl = len(sylRegex.findall(text[i])) + len(syl2Regex.findall(text[i]))
        endsE_set1 = set(endsERegex.findall(text[i]))
        endsE_set2 = set(endsE2Regex.findall(text[i]))
        endsE = len(endsE_set1.union(endsE_set2))
    
        count.append(syl - endsE + len(beginVRegex.findall(text[i])) + len(exceptions_add.findall(text[i]))-len(exceptions_minus.findall(text[i])))
        print((text[i]))
        print((sylRegex.findall(text[i])))
        print((syl2Regex.findall(text[i])))
        print((endsERegex.findall(text[i])))
        print((endsERegex.findall(text[i])))
        print((beginVRegex.findall(text[i])))
        print(count) 
        
    return count==[5,7,5]

import re, string
def is_haiku(text):
    text = text.translate(str.maketrans('', '', string.punctuation))
    text = text.lower().splitlines() # Convert text to lowercase and split by lines
    # Count as a syllable if consonant followed by vowel
    sylRegex = re.compile(r'[^aeiouy\s][aeiouy]') #consonant vowel
    syl2Regex = re.compile(r'''                 #for edge cases
    (ia[^lgn])|(riet)|
    (iu)|([^tn]io[^nr])|(ii)|
    ([aeiouym]bl$)|(aeiou){3}|(^mc)|(ism$)|
    (([^aeiouy])\1l$)|([^l]lien)|
    (^coa[dglx].)|([^gq]ua[^auieol])|(dnt$)''', re.VERBOSE)
    endsERegex = re.compile(r'[^aeiouy][aeiouy][aeiou]*[^e\s]+e(?:\s|$)') # -1 syllable if the word ends with "e"
    endsE2Regex = re.compile(r'^\b[ea]\w{1,2}e(?:\s|$)') # age, aide, edge
    beginVRegex = re.compile(r'\b[aeiouy]') # +1 syllable if the word begins with a vowel
    exceptions_add = re.compile(r'''(triangle)''') #based on random case failures
    exceptions_minus = re.compile(r'''(obvious)''')

# Counts for each line
    count = []
    for i in range(len(text)):
        syl = len(sylRegex.findall(text[i])) + len(syl2Regex.findall(text[i]))
        endsE_set1 = set(endsERegex.findall(text[i]))
        endsE_set2 = set(endsE2Regex.findall(text[i]))
        endsE = len(endsE_set1.union(endsE_set2))
    
        count.append(syl - endsE + len(beginVRegex.findall(text[i])) + len(exceptions_add.findall(text[i]))-len(exceptions_minus.findall(text[i])))
        print((text[i]))
        print((sylRegex.findall(text[i])))
        print((syl2Regex.findall(text[i])))
        print((endsERegex.findall(text[i])))
        print((endsERegex.findall(text[i])))
        print((beginVRegex.findall(text[i])))
        print(count) 
        
    return count==[5,7,5]
