input: Write a python function to identify frequent phrases of length 2 to 4 in a given string. 
  assert frequent_phrases("In the morning, the sun rises in the east and sets in the west. In the evening, the stars come out and shine in the night sky. The moon rises in the east and sets in the west.") == {'moon rises in', 'stars come out', 'rises in the', 'the east and sets', 'sets in the west', 'in the evening', 'the moon rises', 'the night sky', 'in the east and', 'in the morning', 'the sun rises', 'shines in the', 'east and sets', 'the stars come', 'come out and', 'sun rises in', 'out and shine', 'the west in', 'the west', 'evening the stars'}
  assert frequent_phrases("The quick brown fox jumps over the lazy dog.") == {'The quick brown', 'quick brown fox', 'brown fox jumps', 'fox jumps over', 'jumps over the', 'over the lazy', 'the lazy dog'}
  assert frequent_phrases("Hello world! Hello universe!") == {'Hello world Hello', 'world Hello universe', 'Hello universe'}
output: def frequent_phrases(text):
      from collections import Counter
      import re
  
      # Normalize the text
      text = text.lower()
      words = re.findall(r'\b\w+\b', text)
  
      phrases = []
      for length in range(2, 5):  # for lengths 2, 3, and 4
          for i in range(len(words) - length + 1):
              phrase = ' '.join(words[i:i + length])
              phrases.append(phrase)
  
      # Count occurrences of each phrase
      phrase_counts = Counter(phrases)
      
      # Filter out phrases that occur only once
      frequent = {phrase for phrase, count in phrase_counts.items() if count > 1}
  
      return frequent