Processing is essentially a wrapper around Java, so you would use Java syntax to reimplement this code. Something like:
HashMap<String, int> wordCount;
int createProbabilityHash(words):
int numWords = words.size();
wordCount = new HashMap<String, int>();
for (int i = 0;i < numWords; ++i) {
if wordCount.containsKey(words[i]) {
wordCount.put(words[i], wordCount.get(words[i]) + 1);
} else {
wordCount.put(words[i], 1);
}
}
Or you can use pyprocessing and use all the Processing coolness from Python.
(I assume there is more to this method, since your original Python code never returns anything, nor actually does anything with wordCount, or actually computes any kind of hash value.)