title: I write analyze function to return count of token
body: <p>I  write analyze function to return count of token</p>
  
  <pre><code>def analyze(self, text):
      tokenizer = nltk.tokenize.TweetTokenizer()
  
      with open(text, 'r') as lines:
          tokens = tokenizer.tokenize(str(lines))
          score = 0
  
          for token in tokens:
              if token.lower() in self.negatives:
                  score -= 1
              elif token.lower() in self.positives:
                  score += 1
      return score
  </code></pre>
  
  <p>Call:</p>
  
  <pre><code>print(search.analyze('cat.txt'))
  </code></pre>
  
  <p>Output:
  0</p>