Search in sources :

Example 11 with FunctionDescriptor

use of com.joliciel.talismane.machineLearning.features.FunctionDescriptor in project jochre by urieli.

the class SplitFeatureParser method getSplitFeatureSet.

public Set<SplitFeature<?>> getSplitFeatureSet(List<String> featureDescriptors) {
    Set<SplitFeature<?>> features = new TreeSet<SplitFeature<?>>();
    FunctionDescriptorParser descriptorParser = new FunctionDescriptorParser();
    for (String featureDescriptor : featureDescriptors) {
        LOG.trace(featureDescriptor);
        if (featureDescriptor.length() > 0 && !featureDescriptor.startsWith("#")) {
            FunctionDescriptor functionDescriptor = descriptorParser.parseDescriptor(featureDescriptor);
            List<SplitFeature<?>> myFeatures = this.parseDescriptor(functionDescriptor);
            features.addAll(myFeatures);
        }
    }
    return features;
}
Also used : TreeSet(java.util.TreeSet) FunctionDescriptorParser(com.joliciel.talismane.machineLearning.features.FunctionDescriptorParser) FunctionDescriptor(com.joliciel.talismane.machineLearning.features.FunctionDescriptor)

Aggregations

FunctionDescriptor (com.joliciel.talismane.machineLearning.features.FunctionDescriptor)11 FunctionDescriptorParser (com.joliciel.talismane.machineLearning.features.FunctionDescriptorParser)9 TreeSet (java.util.TreeSet)7 ArrayList (java.util.ArrayList)4 BooleanFeature (com.joliciel.talismane.machineLearning.features.BooleanFeature)3 TalismaneException (com.joliciel.talismane.TalismaneException)2 Feature (com.joliciel.talismane.machineLearning.features.Feature)2 AbstractFeature (com.joliciel.talismane.machineLearning.features.AbstractFeature)1 DoubleFeature (com.joliciel.talismane.machineLearning.features.DoubleFeature)1 FeatureSyntaxException (com.joliciel.talismane.machineLearning.features.FeatureSyntaxException)1 IntegerFeature (com.joliciel.talismane.machineLearning.features.IntegerFeature)1 StringFeature (com.joliciel.talismane.machineLearning.features.StringFeature)1 Transition (com.joliciel.talismane.parser.Transition)1 PosTag (com.joliciel.talismane.posTagger.PosTag)1 PosTaggerContext (com.joliciel.talismane.posTagger.PosTaggerContext)1 PosTaggedTokenFeature (com.joliciel.talismane.posTagger.features.PosTaggedTokenFeature)1