Constructor
new RegexNamedEntity(settings)
Constructor of the class.
Parameters:
Name | Type | Description |
---|---|---|
settings |
Object | Settings for the instance. |
- Source:
Methods
(static) regex2str(regex) → {String}
Transforms a regular expression to a string.
Parameters:
Name | Type | Description |
---|---|---|
regex |
RegExp | Regular expression. |
- Source:
Returns:
String representing the regular expression.
- Type
- String
(static) str2regex(str) → {RegExp}
Transforms a string to a regular expression.
Parameters:
Name | Type | Description |
---|---|---|
str |
String | String to be converted. |
- Source:
Returns:
Regular expression.
- Type
- RegExp
addRegex(srcLanguages, regex)
Assign a regular expression for the given languages
Parameters:
Name | Type | Description |
---|---|---|
srcLanguages |
Array.<String> | Target languages |
regex |
RegExp | Regular expression. |
- Source:
addStrRegex(srcLanguages, regex)
Adds a regular expression from a string.
Parameters:
Name | Type | Description |
---|---|---|
srcLanguages |
Array.<String> | Array of languages. |
regex |
String | Regular expression as string. |
- Source:
extract(utterance, language) → {Array.<Object>}
Extract edges of an utterance.
Parameters:
Name | Type | Description |
---|---|---|
utterance |
String | Input utterance. |
language |
String | Language of the utterance. |
- Source:
Returns:
Edges extracted.
- Type
- Array.<Object>
getMatchs(utterance, regex) → {Array.<Object>}
Get the matchs of the regular expression over the utterance.
Parameters:
Name | Type | Description |
---|---|---|
utterance |
String | Input utterance. |
regex |
RegExp | Regular expression. |
- Source:
Returns:
Edges found.
- Type
- Array.<Object>