// Path: nicta-ner/src/main/java/org/t3as/ner/classifier/feature/FeatureMap.java
// @Immutable
// public class FeatureMap {
// 
//     private final Map<EntityClass, List<Feature>> featureMap = new LinkedHashMap<>();
//     private final boolean tracing;
//     public Collection<String> trace;
// 
//     public FeatureMap(final boolean tracing) { this.tracing = tracing; }
// 
//     public void addFeature(final String entityType, final Feature feature) {
//         final EntityClass type = new EntityClass(entityType);
//         List<Feature> features = featureMap.get(type);
//         if (features == null) {
//             features = new ArrayList<>();
//             featureMap.put(type, features);
//         }
//         features.add(feature);
//     }
// 
//     public Map<EntityClass, Double> score(final Phrase p) {
//         final Map<EntityClass, Double> scores = new LinkedHashMap<>();
//         if (tracing) trace = new ArrayList<>();
//         for (final Map.Entry<EntityClass, List<Feature>> e : featureMap.entrySet()) {
//             double score = 0;
//             for (final Feature f : e.getValue()) {
//                 final double s = f.score(p);
//                 score += s;
//                 if (tracing && s != 0) {
//                     trace.add("'" + p.phraseString() + "', w=" + e.getKey() + ":" + f.getWeight()
//                               + ", s=" + s + ", " + f.ident());
//                 }
//             }
//             scores.put(e.getKey(), score);
//         }
//         return scores;
//     }
// 
//     @Override
//     public String toString() {
//         return "FeatureMap{" +
//                "featureMap=" + featureMap +
//                '}';
//     }
// 
//     @Override
//     public boolean equals(final Object o) {
//         if (this == o) return true;
//         if (o == null || getClass() != o.getClass()) return false;
//         final FeatureMap that = (FeatureMap) o;
//         return featureMap.equals(that.featureMap);
//     }
// 
//     @Override
//     public int hashCode() { return featureMap.hashCode(); }
// }
// 
// Path: nicta-ner/src/main/java/org/t3as/ner/classifier/feature/Feature.java
// public static Feature generateFeatureByName(final String featureType, final int weight, final List<String> resourceNames)
//         throws IllegalArgumentException, IOException {
//     switch (featureType) {
//         case "RuledWordFeature":
//             return new RuledWordFeature(resourceNames, weight);
//         case "PrepositionContextFeature":
//             return new PrepositionContextFeature(resourceNames, weight);
//         case "ExistingPhraseFeature":
//             return new ExistingPhraseFeature(resourceNames, weight);
//         case "ExistingCleanPhraseFeature":
//             return new ExistingCleanPhraseFeature(resourceNames, weight);
//         case "CaseSensitiveWordLookup":
//             return new CaseSensitiveWordLookup(resourceNames, weight);
//         case "CaseInsensitiveWordLookup":
//             return new CaseInsensitiveWordLookup(resourceNames, weight);
//         default:
//             throw new IllegalArgumentException("Unknown feature: '" + featureType + "'");
//     }
// }


import org.t3as.ner.classifier.feature.FeatureMap;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import java.io.IOException;
import static com.google.common.collect.ImmutableList.of;
import static org.t3as.ner.classifier.feature.Feature.generateFeatureByName;
import static org.testng.Assert.assertEquals;
/*
 * #%L
 * NICTA t3as Named-Entity Recognition library
 * %%
 * Copyright (C) 2010 - 2014 NICTA
 * %%
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public
 * License along with this program.  If not, see
 * <http://www.gnu.org/licenses/gpl-3.0.html>.
 * #L%
 */
package org.t3as.ner.resource;




public class ConfigurationTest {

    @DataProvider(name = "configTest")
    public Object[][] configTestProvider() throws IOException {
        final FeatureMap featureMap = new FeatureMap(false);
// Path: nicta-ner/src/main/java/org/t3as/ner/classifier/feature/FeatureMap.java
// @Immutable
// public class FeatureMap {
// 
//     private final Map<EntityClass, List<Feature>> featureMap = new LinkedHashMap<>();
//     private final boolean tracing;
//     public Collection<String> trace;
// 
//     public FeatureMap(final boolean tracing) { this.tracing = tracing; }
// 
//     public void addFeature(final String entityType, final Feature feature) {
//         final EntityClass type = new EntityClass(entityType);
//         List<Feature> features = featureMap.get(type);
//         if (features == null) {
//             features = new ArrayList<>();
//             featureMap.put(type, features);
//         }
//         features.add(feature);
//     }
// 
//     public Map<EntityClass, Double> score(final Phrase p) {
//         final Map<EntityClass, Double> scores = new LinkedHashMap<>();
//         if (tracing) trace = new ArrayList<>();
//         for (final Map.Entry<EntityClass, List<Feature>> e : featureMap.entrySet()) {
//             double score = 0;
//             for (final Feature f : e.getValue()) {
//                 final double s = f.score(p);
//                 score += s;
//                 if (tracing && s != 0) {
//                     trace.add("'" + p.phraseString() + "', w=" + e.getKey() + ":" + f.getWeight()
//                               + ", s=" + s + ", " + f.ident());
//                 }
//             }
//             scores.put(e.getKey(), score);
//         }
//         return scores;
//     }
// 
//     @Override
//     public String toString() {
//         return "FeatureMap{" +
//                "featureMap=" + featureMap +
//                '}';
//     }
// 
//     @Override
//     public boolean equals(final Object o) {
//         if (this == o) return true;
//         if (o == null || getClass() != o.getClass()) return false;
//         final FeatureMap that = (FeatureMap) o;
//         return featureMap.equals(that.featureMap);
//     }
// 
//     @Override
//     public int hashCode() { return featureMap.hashCode(); }
// }
// 
// Path: nicta-ner/src/main/java/org/t3as/ner/classifier/feature/Feature.java
// public static Feature generateFeatureByName(final String featureType, final int weight, final List<String> resourceNames)
//         throws IllegalArgumentException, IOException {
//     switch (featureType) {
//         case "RuledWordFeature":
//             return new RuledWordFeature(resourceNames, weight);
//         case "PrepositionContextFeature":
//             return new PrepositionContextFeature(resourceNames, weight);
//         case "ExistingPhraseFeature":
//             return new ExistingPhraseFeature(resourceNames, weight);
//         case "ExistingCleanPhraseFeature":
//             return new ExistingCleanPhraseFeature(resourceNames, weight);
//         case "CaseSensitiveWordLookup":
//             return new CaseSensitiveWordLookup(resourceNames, weight);
//         case "CaseInsensitiveWordLookup":
//             return new CaseInsensitiveWordLookup(resourceNames, weight);
//         default:
//             throw new IllegalArgumentException("Unknown feature: '" + featureType + "'");
//     }
// }


// Path: nicta-ner/src/test/java/org/t3as/ner/resource/ConfigurationTest.java
import org.t3as.ner.classifier.feature.FeatureMap;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import java.io.IOException;
import static com.google.common.collect.ImmutableList.of;
import static org.t3as.ner.classifier.feature.Feature.generateFeatureByName;
import static org.testng.Assert.assertEquals;

/*
 * #%L
 * NICTA t3as Named-Entity Recognition library
 * %%
 * Copyright (C) 2010 - 2014 NICTA
 * %%
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public
 * License along with this program.  If not, see
 * <http://www.gnu.org/licenses/gpl-3.0.html>.
 * #L%
 */
package org.t3as.ner.resource;




public class ConfigurationTest {

    @DataProvider(name = "configTest")
    public Object[][] configTestProvider() throws IOException {
        final FeatureMap featureMap = new FeatureMap(false);
        featureMap.addFeature("LOCATION",     generateFeatureByName("ExistingPhraseFeature", 3,