
package com.uwetrottmann.shopr.algorithm.model;

import com.uwetrottmann.shopr.algorithm.model.Attributes.AttributeValue;

import java.util.Arrays;

public class ClothingType extends GenericAttribute {

    public static final String ID = "clothing-type";

    public enum Value implements AttributeValue {
        SWIMSUIT("Swim suit"),
        TRUNKS("Trunks"),
        BLOUSE("Blouse"),
        SHIRT("Shirt"),
        TROUSERS("Trouser"),
        JACKET("Jacket"),
        JEANS("Jeans"),
        DRESS("Dress"),
        POLOSHIRT("Poloshirt"),
        SWEATER("Sweater"), // Pullover
        SKIRT("Skirt"),
        SHORTS("Shorts"),
        PANTS("Pants"),
        CARDIGAN("Cardigan"), // Strickjacke
        TOP("Top/T-Shirt");

        String mDescriptor;

        Value(String descriptor) {
            mDescriptor = descriptor;
        }

        @Override
        public String descriptor() {
            return mDescriptor;
        }

        @Override
        public int index() {
            return ordinal();
        }
    }

    public ClothingType() {
        int numValues = Value.values().length;
        mValueWeights = new double[numValues];
        Arrays.fill(mValueWeights, 1.0 / numValues);
    }

    public ClothingType(Value value) {
        setWeights(value);
    }

    public ClothingType(String name) {
        if ("Badeanzug".equals(name)) {
            setWeights(Value.SWIMSUIT);
        }
        else if ("Badehose".equals(name)) {
            setWeights(Value.TRUNKS);
        }
        else if ("Bluse".equals(name)) {
            setWeights(Value.BLOUSE);
        }
        else if ("Hemd".equals(name)) {
            setWeights(Value.SHIRT);
        }
        else if ("Hose".equals(name)) {
            setWeights(Value.TROUSERS);
        }
        else if ("Jacke".equals(name)) {
            setWeights(Value.JACKET);
        }
        else if ("Jeans".equals(name)) {
            setWeights(Value.JEANS);
        }
        else if ("Kleid".equals(name)) {
            setWeights(Value.DRESS);
        }
        else if ("Poloshirt".equals(name)) {
            setWeights(Value.POLOSHIRT);
        }
        else if ("Pullover".equals(name)) {
            setWeights(Value.SWEATER);
        }
        else if ("Rock".equals(name)) {
            setWeights(Value.SKIRT);
        }
        else if ("Stoffhose".equals(name)) {
            setWeights(Value.PANTS);
        }
        else if ("Strickjacke".equals(name)) {
            setWeights(Value.CARDIGAN);
        }
        else if ("Top".equals(name)) {
            setWeights(Value.TOP);
        }
        else if ("Shorts".equals(name)) {
            setWeights(Value.SHORTS);
        }
    }

    private void setWeights(Value value) {
        mValueWeights = new double[Value.values().length];
        Arrays.fill(mValueWeights, 0.0);
        mValueWeights[value.ordinal()] = 1.0;
        currentValue(value);
    }

    @Override
    public String id() {
        return ID;
    }

    @Override
    public Value[] getValueSymbols() {
        return Value.values();
    }

}

@@ -437,34 +437,9 @@
 user
-%22),%0A        JACKET(%22Jacket
+s
 %22),%0A
@@ -612,32 +612,8 @@
 %22),%0A
-        PANTS(%22Pants%22),%0A
     
@@ -1733,97 +1733,8 @@
   %7D%0A
-        else if (%22Jacke%22.equals(name)) %7B%0A            setWeights(Value.JACKET);%0A        %7D%0A
     
@@ -2185,100 +2185,8 @@
   %7D%0A
-        else if (%22Stoffhose%22.equals(name)) %7B%0A            setWeights(Value.PANTS);%0A        %7D%0A
     

Remove jacket and pants type, correctly spell trousers.