Looks up matches to regular expressions in a dictionary and then tags the match with one or more semantic tags as an alternative representation(s).
Operates On: Lexical Items with TOKEN flag
All possibilities are tagged, including overlaps and sub-patterns, with the expectation that later disambiguation stages will choose which tags are the correct interpretation.
{ "type":"DictionaryTagger", "patterns":"regex-provider:patterns", "caseInsensitive": true }
In the following example, "What's your name" is in the dictionary as a regex for self-name, and there are also regex for number "[0-9]+" and "[0-9]+\\.[0-9]+" :
V--------------------------------------[What's your name 12 @#$ 25 63.3]---------------------------------------V ^-----[What's]-----V--[your]--V--[name]--V-----[12]-----V--[@#$]--V-----[25]-----V-----------[63.3]------------^ ^--[What]--V--[s]--^ ^--[{number}]--^ ^--[{number}]--^-----[63]-----V-----[3]------^ ^-----[what's]-----^ ^---------[{number}]----------^ ^--[what]--^ ^--[{number}]--^--[{number}]--^ ^-------------[{self-name}]--------------^ ^---------[{number}]----------^ ^-------------[{self-name}]--------------^ ^-------------[{self-name}]--------------^ ^-------------[{self-name}]--------------^
The regex pattern must have an "pattern dictionary" (a string to JSON map) which is a list of JSON records, indexed by entity ID. In addition, there may also be a pattern map and a token index.
The only file which is absolutely required is the pattern dictionary. It is a series of JSON records, typically indexed by entity ID.
Each JSON record represents an entity. The format is as follows:
{ "_id" : "ca84", "tags" : [ "number" ], "patterns" : [ "[0-9]+", "[0-9]+\\.[0-9]+" ], "confidence" : 0.95 . . . additional fields as needed go here . . . }