Search in sources :

Example 6 with FunctionDescriptorParser

use of com.joliciel.talismane.machineLearning.features.FunctionDescriptorParser in project talismane by joliciel-informatique.

the class TokenPatternMatchFeatureParser method getTokenPatternMatchFeatureSet.

public Set<TokenPatternMatchFeature<?>> getTokenPatternMatchFeatureSet(List<String> featureDescriptors) {
    Set<TokenPatternMatchFeature<?>> features = new TreeSet<TokenPatternMatchFeature<?>>();
    FunctionDescriptorParser descriptorParser = new FunctionDescriptorParser();
    for (String featureDescriptor : featureDescriptors) {
        if (featureDescriptor.length() > 0 && !featureDescriptor.startsWith("#")) {
            FunctionDescriptor functionDescriptor = descriptorParser.parseDescriptor(featureDescriptor);
            List<TokenPatternMatchFeature<?>> 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)

Example 7 with FunctionDescriptorParser

use of com.joliciel.talismane.machineLearning.features.FunctionDescriptorParser in project talismane by joliciel-informatique.

the class SentenceDetectorFeatureParser method getFeatureSet.

public Set<SentenceDetectorFeature<?>> getFeatureSet(List<String> featureDescriptors) {
    Set<SentenceDetectorFeature<?>> features = new TreeSet<SentenceDetectorFeature<?>>();
    FunctionDescriptorParser descriptorParser = new FunctionDescriptorParser();
    for (String featureDescriptor : featureDescriptors) {
        if (featureDescriptor.length() > 0 && !featureDescriptor.startsWith("#")) {
            FunctionDescriptor functionDescriptor = descriptorParser.parseDescriptor(featureDescriptor);
            List<SentenceDetectorFeature<?>> 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)

Example 8 with FunctionDescriptorParser

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

the class MergeFeatureParser method getMergeFeatureSet.

public Set<MergeFeature<?>> getMergeFeatureSet(List<String> featureDescriptors) {
    Set<MergeFeature<?>> features = new TreeSet<MergeFeature<?>>();
    FunctionDescriptorParser descriptorParser = new FunctionDescriptorParser();
    for (String featureDescriptor : featureDescriptors) {
        LOG.trace(featureDescriptor);
        if (featureDescriptor.length() > 0 && !featureDescriptor.startsWith("#")) {
            FunctionDescriptor functionDescriptor = descriptorParser.parseDescriptor(featureDescriptor);
            List<MergeFeature<?>> 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)

Example 9 with FunctionDescriptorParser

use of com.joliciel.talismane.machineLearning.features.FunctionDescriptorParser 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)9 FunctionDescriptorParser (com.joliciel.talismane.machineLearning.features.FunctionDescriptorParser)9 TreeSet (java.util.TreeSet)7 TalismaneException (com.joliciel.talismane.TalismaneException)2 BooleanFeature (com.joliciel.talismane.machineLearning.features.BooleanFeature)2 ArrayList (java.util.ArrayList)2 Transition (com.joliciel.talismane.parser.Transition)1 PosTag (com.joliciel.talismane.posTagger.PosTag)1 PosTaggerContext (com.joliciel.talismane.posTagger.PosTaggerContext)1