Ejemplo n.º 1
0
 private MatcherSettings(MatcherSettings <TOffset> other)
 {
     _dir              = other._dir;
     _filter           = other._filter;
     _useDefaults      = other._useDefaults;
     _nondeterministic = other._nondeterministic;
     _anchoredToStart  = other._anchoredToStart;
     _anchoredToEnd    = other._anchoredToEnd;
     _allSubmatches    = other._allSubmatches;
     _matchingMethod   = other._matchingMethod;
 }
        public List <MatchResult> MatchEntities(ProcessedDataset processedDataset, List <string> dataset, string inputSentence, MatchingMethod matchingMethod, float threshold = default, int ngramSize = default)
        {
            var matchingThreshold = threshold == default ? PostProcessingThreshold : threshold;

            switch (matchingMethod)
            {
            case MatchingMethod.NoMatchIndices:
                return(MatchEntitiesWithoutIndices(processedDataset, dataset, inputSentence, ngramSize));

            case MatchingMethod.PreprocessInputSentence:
                return(MatchEntitiesWithIndicesPreTokenizeApproach(processedDataset, dataset, inputSentence, matchingThreshold, ngramSize));

            case MatchingMethod.PostprocessInputSentence:
                return(MatchEntitiesWithIndicesPostTokenizeApproach(processedDataset, dataset, inputSentence, matchingThreshold, ngramSize));

            default:
                throw new Exception("Matching method not supported!");
            }
        }