def class_weight(self, elem):
        weight = 0
        for feature in [elem.get('class', None), elem.get('id', None)]:
            try:
                if feature:
                    if REGEXES['negativeRe'].search(feature):
                        weight -= 25

                    if REGEXES['positiveRe'].search(feature):
                        weight += 25
            except:
                continue
        return weight