processor
processor
Functions
| Name | Description |
|---|---|
| build_expressions | Build a list of valid landmark expressions |
| evaluate_math | Ensure the landmark expression is only |
| find_vars | Find landmark variables in expression |
| inject_values | Replace landmark variable names with |
| parse_expression | Parse a landmark expression and return |
| rgetattr | gets object attribute from string |
build_expressions
processor.build_expressions()
Build a list of valid landmark expressions
Returns
| Type | Description |
|---|---|
| list[str] | List of landmark regexes |
evaluate_math
processor.evaluate_math(x)
Ensure the landmark expression is only valid mathematical expressions.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
x |
str | The numeric string | required |
Returns
| Type | Description |
|---|---|
| bool | If the string is only valid math, True. Else, False. |
find_vars
processor.find_vars(expression)
Find landmark variables in expression
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
expression |
str | An expression defining a landmark location | required |
Returns
| Type | Description |
|---|---|
| list[str] | List of landmark variables |
inject_values
processor.inject_values(expression, formants)
Replace landmark variable names with numeric strings.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
expression |
str | A landmark expression | required |
formants |
FormantArray | The formant array from which to get the numeric values | required |
Returns
| Type | Description |
|---|---|
| str | The numeric string |
parse_expression
processor.parse_expression(expression, formants)
Parse a landmark expression and return the resulting numeric value.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
expression |
str | A landmark expression | required |
formants |
FormantArray | The formant array with which to evaluate the expression | required |
Returns
| Type | Description |
|---|---|
| float | The resulting value |
rgetattr
processor.rgetattr(obj, attr, *args)
gets object attribute from string
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
obj |
type |
object | required |
attr |
str |
attribute path attr.attr.attr | required |