Logic for Pocket items' tags analysis, in Ruby