input: Write a function to analyze the sentiment of given text and categorize it into positive, negative, and neutral sentiments using the NaiveBayesClassifier from the nltk library. If the input text has more negative sentences than positive, it should return 'negative'. If there are more positive sentences, it should return 'positive'. If the number of positive and negative sentences is equal, it should return 'neutral'. The function should tokenize the input text into sentences before performing sentiment analysis.
  
  assert analyze_sentiment("This is a good day.") == 'positive'
  assert analyze_sentiment("This is a bad day.") == 'negative'
  assert analyze_sentiment("Today is neither good nor bad.") == 'neutral'
  assert analyze_sentiment("") == 'neutral'
  assert analyze_sentiment("The weather is not great, but it's not terrible.") == 'neutral'
output: from nltk.tokenize import sent_tokenize
  from nltk.classify import NaiveBayesClassifier
  
  def analyze_sentiment(text):
      if not text:
          return 'neutral'
      
      sentences = sent_tokenize(text)
      positive_count = 0
      negative_count = 0
      
      for sentence in sentences:
          sentiment = classifier.classify(extract_features(sentence))
          if sentiment == 'positive':
              positive_count += 1
          elif sentiment == 'negative':
              negative_count += 1
      
      if positive_count > negative_count:
          return 'positive'
      elif negative_count > positive_count:
          return 'negative'
      else:
          return 'neutral'