package com.grayben.riskExtractor.htmlScorer.partScorers.tagScorers;

import com.grayben.riskExtractor.htmlScorer.partScorers.TagAndAttribute;

import java.util.HashMap;
import java.util.Map;

public class TagAndAttributeScorer
		extends MapScorer<TagAndAttribute> {

    public final static String SCORE_LABEL
            = "tag-and-attribute-emphasis";

    protected TagAndAttributeScorer(Map<TagAndAttribute, Integer> tagScores) {
        super(SCORE_LABEL, tagScores);
    }

    @Override
	public int score(TagAndAttribute input) {
		return super.score(input);
	}

	@Override
	public String getScoreLabel() {
		return null;
	}

	public static final Map<TagAndAttribute, Integer> defaultMap() {

		Map<TagAndAttribute, Integer> scoreMap = new HashMap<>();
//		scoreMap.put(Tag.valueOf("b"), 1);
//		scoreMap.put(Tag.valueOf("strong"), 1);
//		scoreMap.put(Tag.valueOf("h1"), 1);
//		scoreMap.put(Tag.valueOf("h2"), 1);
//		scoreMap.put(Tag.valueOf("h3"), 1);
//		scoreMap.put(Tag.valueOf("h4"), 1);
//		scoreMap.put(Tag.valueOf("h5"), 1);
//		scoreMap.put(Tag.valueOf("u"), 1);

		return scoreMap;

	}


}

@@ -140,55 +140,166 @@
 te;%0A
-%0Aimport java.util.HashMap;%0Aimport java.util.Map
+import org.jsoup.nodes.Attribute;%0Aimport org.jsoup.parser.Tag;%0A%0Aimport java.util.HashMap;%0Aimport java.util.HashSet;%0Aimport java.util.Map;%0Aimport java.util.Set
 ;%0A%0Ap
@@ -809,48 +809,79 @@
  %7B%0A%0A
-%09%09Map%3CTagAndAttribute, Integer%3E scoreMap
+        String%5B%5D tagNames = %7B%22font%22, %22div%22, %22p%22%7D;%0A        Set%3CTag%3E tags
  = n
@@ -891,317 +891,796 @@
 Hash
-Map
+Set
 %3C%3E();%0A
-//%09%09scoreMap.put(Tag.valueOf(%22b%22), 1);%0A//%09%09scoreMap.put(Tag.valueOf(%22strong%22), 1);%0A//%09%09scoreMap.put(Tag.valueOf(%22h1%22), 1);%0A//%09%09scoreMap.put(Tag.valueOf(%22h2%22), 1);%0A//%09%09scoreMap.put(Tag.valueOf(%22h3%22), 1);%0A//%09%09scoreMap.put(Tag.valueOf(%22h4%22), 1);%0A//%09%09
+        for (String tagName: tagNames) %7B%0A            tags.add(Tag.valueOf(tagName));%0A        %7D%0A%0A        Set%3CAttribute%3E attributes = new HashSet%3C%3E();%0A        attributes.add(new Attribute(%22style%22, %22bold%22));%0A        attributes.add(new Attribute(%22style%22, %22underline%22));%0A%0A        Set%3CTagAndAttribute%3E tagAndAttributes = new HashSet%3C%3E();%0A        for (Tag tag: tags)%0A            for (Attribute attribute : attributes)%0A                tagAndAttributes.add(%0A                        new TagAndAttribute(%0A                                tag,%0A                                attribute%0A                        )%0A                );%0A%0A        Map%3CTagAndAttribute, Integer%3E 
 score
+s
 Map
-.put(Tag.valueOf(%22h5%22), 1);%0A//%09%09
+ = new HashMap%3C%3E();%0A        for (TagAndAttribute tagAndAttribute : tagAndAttributes) %7B%0A            
 score
+s
 Map.put(
 Tag.
@@ -1679,33 +1679,48 @@
 put(
-Tag.valueOf(%22u%22), 1);%0A%0A%09%09
+tagAndAttribute, 1);%0A        %7D%0A%0A        
 retu
@@ -1727,16 +1727,17 @@
 rn score
+s
 Map;%0A%0A%09%7D

Add default scores map