user
Write a pseudo-code that can detect whether a given sentence is positive or negative.

Answer:
assistant
func sentimentAnalysis(sentence):
  // Initialize the sentiment score
  sentimentScore = 0

  // Split the sentence into words
  words = sentence.split(' ')

  // Loop through each word
  for word in words
    // Check if word is in sentiment dictionary
    sentimentValue = checkSentimentDictionary(word)

    // Calculate sentiment score
    sentimentScore = sentimentScore + sentimentValue

  // Return the sentiment score
  return sentimentScore