title: markov chain python to processing
body: <p>I made a python project based on markov chains to create sentences. Now I have to make the same thing but in processing. Here is the python code I need help with: <code>def createProbabilityHash(words)</code>:</p>
  
  <pre><code>def createProbabilityHash(words):
      numWords = len(words)
      wordCount = {}
      for word in words:
          if wordCount.has_key(word):
              wordCount[word] += 1
          else:
              wordCount[word] = 1
  </code></pre>