Namespace: utils

utils

Source:

Members

(static, constant) exports.addFeedbackToResponse

Generates the final response by adding feedback and commands to it.

Source:

(static, constant) exports.addThousandsSeparators

Adds thousands separators for large numbers.

Source:

(static, constant) exports.addVariationInformation

Adds CV information to the data.

Source:

(static, constant) exports.computeMetadata

Computes CV from metadata for relaying uncertainty information.

Source:

(static, constant) exports.createTemporaryElement

Creates a temporary element to relay response to screen readers.

Source:

(static, constant) exports.formatOptions

Formats the options, specifically the xLabel and yLabel.

Source:

(static, constant) exports.generateInstructions

Generates the initial instructions for VoxLens.

Source:

(static, constant) exports.getArrayFromObject

Converts an object into an array.

Source:

(static, constant) exports.getDefaults

Finds the defaults for VoxLens.

Source:

(static, constant) exports.getInstructionsText

Generates the detailed instructions for VoxLens.

Source:

(static, constant) exports.getKeyBinds

Generates key bindings for a given set of combinations.

Source:

(static, constant) exports.getKeyFromEvent

Converts the event code into the face value of the key.

Source:

(static, constant) exports.getModifier

Finds the modifier using the settings. A modifier is the set of key bindings to trigger responses.

Source:

(static, constant) exports.getSettings

Finds settings based on the operating system.

Source:

(static, constant) exports.isCommandDuplicate

Checks to see if the command issued is duplicate.

Source:

(static, constant) exports.logCommand

Logs command issued into the user's local storage.

Source:

(static, constant) exports.logKeyPresses

Logs key presses into the user's local storage.

Source:

(static, constant) exports.sanitizeVoiceText

Sanitizes the voice input by removing stop words and converting words to numbers.

Source:

(static, constant) exports.validate

Validates the data supplied to VoxLens and throws errors where necessary.

Source:

(static, constant) exports.verbalise

Verbalises an array of values by joining each value and adding "and" before the last one.

Source:

(static, constant) os

Finds the operating system of the user.

Source:

(static, constant) stopWords

Set of stop words

Source:

Methods

(static) getFeedbackText() → {string}

Generates a verbose human-friendly response prefixing user's query.

Source:
Returns:
  • Human-friendly verbose response.
Type
string

(static) getMappedTriggers(triggers, modifier) → {Object}

Maps the triggers to a human-readable format to be used in instructions.

Parameters:
Name Type Description
triggers Object

Triggers for each VoxLens mode.

modifier string

The key binding for the trigger.

Source:
Returns:
  • Triggers with their presentable values.
Type
Object