def get_hash_tags_urls_mentions(data): all_data = process_to_words(data) types = {mention: [], word: [], hash_tag: [], url: []} #separate and implying string types for element in all_data: __imply_string_obj(element, types) #creating set with counts for type in types.keys(): types[type] = tools.create_set_with_counts(types[type]) return types
def calculate_min_and_max_words_count(words): set = tools.create_set_with_counts(words) l = int(len(set)) min = l max = 0 for set_el in set: el_count = set_el[1] if min > el_count: min = el_count if max < el_count: max = el_count return min, max, set