ResponsePatternCollection¶
Overview¶
A collection of string patterns that are used with responseCollector.collectResponses(). Responses for Voicing are categorized into one of "Name", "Object", "Context", or "Hint" responses. A node that implements voicing may have any number of these responses and each of these responses can be enabled/disabled by user preferences through the Properties of responseCollector. So we need string patterns that include each combination of response.
Furthermore, you may want to control the order, punctuation, or other content in these patterns, so the default cannot be used. ResponsePatternCollection will have a collections of patterns that may be generally useful. But if you need a collection that is not provided here, you can construct additional instances to create an object based on one of the pre-made collections in this file. If you need something totally different, create your own from scratch (passing in all options to the constructor).
@author Jesse Greenberg (PhET Interactive Simulations)
Class ResponsePatternCollection¶
Constructor¶
new ResponsePatternCollection( providedOptions? : ResponsePatternCollectionOptions )¶
Instance Methods¶
getResponsePattern( key : string ) : string¶
Static Methods¶
createPatternKey( includeName : boolean, includeObject : boolean, includeContext : boolean, includeHint : boolean ) : string¶
Create a key to be used to get a string pattern for a Voicing response. Assumes keys are like those listed in DEFAULT_RESPONSE_PATTERNS.
Static Properties¶
DEFAULT_RESPONSE_PATTERNS : ResponsePatternCollection¶
(readonly)
Default order and punctuation for Voicing responses.
Type ResponsePatternCollectionOptions¶
- nameObjectContextHint?: string
- nameObjectContext?: string
- nameObjectHint?: string
- nameContextHint?: string
- nameObject?: string
- nameContext?: string
- nameHint?: string
- name?: string
- objectContextHint?: string
- objectContext?: string
- objectHint?: string
- contextHint?: string
- object?: string
- context?: string
- hint?: string
Source Code¶
See the source for ResponsePatternCollection.ts in the utterance-queue repository.