Class RegexNameFinder
Name finder based on a series of regular expressions.
public sealed class RegexNameFinder : ITokenNameFinder
- Inheritance
-
RegexNameFinder
- Implements
- Inherited Members
Constructors
RegexNameFinder(IDictionary<string, Regex[]>)
public RegexNameFinder(IDictionary<string, Regex[]> regexMap)
Parameters
regexMapIDictionary<string, Regex[]>
RegexNameFinder(Regex[])
Use the RegexNameFinder(Regex[], string?) constructor for single types, and/or the RegexNameFinder(IDictionary<string, Regex[]>) constructor.
[Obsolete]
public RegexNameFinder(Regex[] patterns)
Parameters
patternsRegex[]
RegexNameFinder(Regex[], string?)
public RegexNameFinder(Regex[] patterns, string? type)
Parameters
Properties
Patterns
public Regex[]? Patterns { get; set; }
Property Value
- Regex[]
Type
public string? Type { get; set; }
Property Value
Methods
ClearAdaptiveData()
Forgets all adaptive data which was collected during previous calls to one of the find methods.
This method is typical called at the end of a document.
public void ClearAdaptiveData()
Find(string)
NEW. This method removes the need for tokenization, but returns the Span with character indices, rather than word.
public Span[] Find(string text)
Parameters
textstringThe text to search.
Returns
- Span[]
The character-index spans of the matches.
Find(string[])
Generates name tags for the given sequence, typically a sentence, returning token spans for any identified names.
public Span[] Find(string[] tokens)
Parameters
tokensstring[]an array of the tokens or words of the sequence, typically a sentence.
Returns
- Span[]
an array of spans for each of the names identified.