So I am searching a large body of text and extracting common phrases, then I end up with an array like this:
Array(
[past due] => 21
[past due notice] => 7
[past due 60 day] => 17
[60 day notice] => 32
)
The keys are the phrases and the values are the number of times that phrase appeared in the given text. In the example above, I would like to combine these keys and sum the values because they all mean the same thing, to me. So I would end up with an array like this:
Array(
[past due] => 77
)
This is just an example, the keys, values, etc. will constantly be changing. I am just starting on this piece of the project so there is no code to post yet. I am just looking for ideas, direction, etc. so I don't have to reinvent the wheel if someone has done something similar or as an idea. As always, thanks in advance!
UPDATE:
With all of the contributions here and in reading other questions, I think I am going to try to group them using regex before I build the array.