I have a large arrray of strings that looks something like this: String temp[] = new String[200000].
I have another String, let\'s call it bigtext. What I ne
An alternative approach would be to tokenize the text - let's say split by common punctuation. Then put these tokens in to a Set
and then find the intersect with the main container.
Instead of an array, hold the words in a Set
too. The intersection can be calculated by simply doing
bidTextSet.retainAll(mainWordsSet);
What remains will be the words that occur in bigText
that are in your "dictionary".