Class: RegexEntityRecognizer

Bravey.RegexEntityRecognizer

new RegexEntityRecognizer(entityName)

Can recognize stacked regular expressions in a sentence.
Parameters:
Name Type Description
entityName string The name of produced entities.
Source:

Methods

addMatch(regex, callback, priorityopt)

Add a new regular expression to the set.
Parameters:
Name Type Attributes Default Description
regex RegExp The regular expression to be matched.
callback regexEntityRecognizerCallback The data processor to be called when the regular expression is matched.
priority number <optional>
0 The priority of produced entities.
Source:

getEntities(string, outopt) → {Array.<Entity>}

Returns all found entities in a sentence. Returned entities value are defined by the specific callbacks.
Parameters:
Name Type Attributes Default Description
string string The sentence to be checked.
out Array.<Entity> <optional>
[] The array in which the found entities will be added.
Source:
Returns:
The set of found entities.
Type
Array.<Entity>

getName() → {string}

Returns the recognizer entity name.
Source:
Returns:
The entity name.
Type
string