mmir-lib
Version:
MMIR (Mobile Multimodal Interaction and Relay) library
2,270 lines • 127 kB
Plain Text
version notes for MMIR framework code
* using Cordova 5.x.x - 9.x.x library
optional
* jQuery 2.x - 3.x library (presence is auto-detected, if loaded before mmir-lib)
* jQuery Mobile 1.4.x library (note: requires jQuery 2.x)
additional, required dependencies when running in node environment
* scxml (tested with version 3.1.5)
* xmlhttprequest (tested with version 1.8.0)
* requirejs (tested with version 2.3.3)
* webworker-threads (OPTIONAL, tested with version 0.8.0);
recommended to use node's internal worker_threads module instead (included as experimental feature since node v 10.x)
which may need to be enabled in earlier versions of node
NOTE: for versions older than MMIR 3.x, the change-information refers to the MMIG StarterKit code.
Since version 3.x the code is restructured:
* mmir-lib: the framework code itself (the contents of its /lib directory would usually be located at /www/mmirf/)
* mmir-tooling: the tools for building resources (would usually be located at /build/)
* mmir-starter-kit: the code for the StarterKit includes mmir-lib and mmir-tooling as well
as a small example application (i.e. basically this is the same as the
StarterKit from pre 3.x versions)
NOTE: the mmir-lib and mmir-tooling code that is used within this example
project may lack behind the most current version of their base
repositories of mmir-lib and mmir-tooling.
--------------
Change Log
--------------
##################
Version 7.0.1
##################
BUGFIX:
* ttsWebspeech: HACK for Chrome BUG (https://issues.chromium.org/issues/41294170)
that causes SpeechSynthesis utterances to stop after ~ 15 secs
WORKAROUND: pause() & immediately resume() in regular intervals seems to circumvent the problem
##################
Version 7.0.0
##################
IMPROVE:
* languageManager:
* update `mmir.conf` with selected language
* listen to `mmir.conf` changes for language setting & update language in `mmir.lang` accordingly
BUGFIX:
* webspeechAudioInput: fixed invalid placeholder function name `failureCallback` -> `failureCallBack`
* ttsWebspeech: fixed search/filtering for voice selection
* added simple check for exact voice-name match
* added RegExp escaping for matching/filtering voice-name via RegExp:
i.e. escape special RegExp character when converting voice-name to filter-RegExp, adapapted from
MIT License, Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com), https://github.com/sindresorhus/escape-string-regexp
##################
Version 7.0.0-beta6
##################
FIX:
* webAudioInput: HACK for handling case the `SpeechRecognition.stop()` does not actually stop if called shortly after `SpeechRecognition.start()` was invoked (tested in `Chrome` v94.x):
WORKAROUND: detect, if `SpeechRecognition.start()` was called shortly before `stopRecord()` is called (currently 60 ms), and if so, do trigger `SpeechRecognition.stop()` delayed
BUGFIX:
* state engineConfig: remove superfluous comma/argument for debug output for printing active state events
##################
Version 7.0.0-beta5
##################
BUGFIX:
* typings: use string typings for log-config field names in LogLevelOptions
##################
Version 7.0.0-beta4
##################
MODIFICATION:
* languageManager.getLanguageConfig(): use current language code as fallback if field "language" is missing
* storageUtils: set file-format version to 5 (due to BUGFIX for views; see below)
NOTE: generated views should be recompiled after updating to this library version
BUGFIX:
* languageManager.getResourceUri("dictionary" | "speechConfig" | "grammar"): do support resource loading of of ES modules with default export
* storageUtils & views: FIXED stringify()-methods for views: do use storageUtils.getCodeWrapSuffix() correctly
(and removed outdated interanl constant STORAGE_CODE_WRAP_SUFFIX)
##################
Version 7.0.0-beta3
##################
REMOVED:
* [BREAKING CHANGE] in manager/dialog: moved factory method for cordova-plugin based event queue to plugin itself
if cordova-plugin base event queue is used, it may cause errors if mmir is initialized before cordova plugin is available
WORKAROUND: wait for initialization of cordova before initializing mmir
ADDITION:
* env/media/cordovaAudio: added support for `getWAVAsAudio()` for `cordova` environment
BUGFIX:
* env/media/cordovaAudio: fixed `playWAV()` for `cordova` environment: do not try to create `Media(Blob -> DataUrl, ...)`, but create & temporary file instead (analogous to new `getWAVAsAudio()` implementation)
* env/media/webAudio: fixed `getWAVAsAudio()` for `web` environment: do release data-blob handle if audio was prematurely released
* mediaManager: added missing placeholder/proxy function for audio output API method `getWAVAsAudio()`
##################
Version 7.0.0-beta2
##################
MODIFICATION:
* lib/vendor: updated/recompiled vendor libraries
* mvc/parser/gen: recompiled view parser libraries
* improved API docs for mediaManager and scion queue worker
##################
Version 7.0.0-beta1
##################
REMOVED:
* [BREAKING CHANGE] in env/media/audiotts:
* removed backwards-compatiblity for deprecated hook `plugin.setMediaManager()`
(plugins must require `mediaManager` directly instead, e.g. `mmir.require('mmirf/mediaManager')`)
* [BREAKING CHANGE] in mediaManager: removed method `mediaManager._get_mmir()`
plugins should require mmir instance instead, e.g.
```
define(['core'], function(mmir){
// -> use mmir instance
})
```
MODIFICATION:
* [BREAKING CHANGE] mediaManager:
* changed initialization interface for media plugins (i.e. signature for exported factory function):
`initialize: function(callBack, mediaManager, ctxId, moduleConfig)` -> `initialize: function(callBack, ctxId, moduleConfig)`
does not pass in the mediaManager instance as second argument anymore (if needed by the plugin, it should `require` it)
* renamed method `mediaManager.loadFile(..)` -> `mediaManager.loadPlugin(..)`
* [BREAKING CHANGE] env/media/audiotts:
* audiotts plugin implementations now need to return a factory function (not the plugin object itself):
`factory(logger)` (the `logger` argument is a logger instance that can be used during its intialization; after initialization it should request a dedicated logger instance via exposing the hook `getLogger()`)
* adapted env/media/ttsMary and env/media/ttsWebspeech plugin implementations according to new factory-interface of audiotts
* [BREAKING CHANGE] configurationManager:
* for configurationManager.get(): the meaning of optional third argument is changed from `useSafeAccess` to `setAsDefaultIfUnset`
support for "unsafe access" is dropped (i.e. throwing an exception if configuration path is not available); instead the third argument
is interpreted as "set specified default value, if there is not value (i.e. undefined) set yet"
* initialization of configurationManager is now asynchronous:
in order to avoid using synchronous XHR requests (for loading configuration data) the initialization is now done asynchronously.
This change can be ignored, if access to the `configurationManager` is done, after `mmir.ready()` has been fired, or initialization interfaces
(e.g. for media plugins) are used.
Otherwise, `configurationManager.init()` will return a promise that is revolved upon its initialization
```
require('mmirf/configurationManager').init().then(function(){
//-> now configuration data is loaded
})
```
* for configurationManager.get(path, ...) / get<String|Boolean>(path, ...) / set(path, ...): in case `path` is an `Array` its entries are not further processed
support for processing string-entries that contain dot-seprating notation is dropped, i.e.
```
mmir.conf.get(['dot', 'separated.path'], ...);
//-> path evaluates to: ['dot', 'separated.path'] instead of ['dot', 'separated', 'path']
```
If processing of path-Arrays with string-entries that contain dot-seprating notation is required, use (new) helper method `toPath(stringOrArray)`:
```
mmir.conf.get(mmir.toPath(['dot', 'separated.path']), ...);
//-> mmir.toPath(['dot', 'separated.path']) -> ['dot', 'separated', 'path']
```
* for configurationManager.on() / configurationManager.addListener():
the 3rd argument `path` is now an `Array` of strings, instead of a (dot-seperated) property-path string
(where the last entry of the `Array` is the property name itself)
```
// old interface:
ConfigurationChangeListener(newValue: any, oldValue: any, propertyName: string) => void
// -> new interface:
ConfigurationChangeListener(newValue: any, oldValue: any, propertyName: string[]) => void
```
* manager/dialog: changed implementation for WebWorker based event queuing:
only use 1 Worker instance for all dialog engines (instead of one Worker per dialog engine)
* env/view/viewLoader: changed internal `isUpToDate(...)` to use asynchronous XHR requests
ADDITION:
* mediaManager: support non-function/disabled result when loading media-plugins
* expose field `mediaManager.plugins` of all loaded media plugins
* extended plugin interface initialized-callback: function(exportedFunctions) -> function(exportedFunctions, /*optional: */nonFunctionalInfo)
* provide conveinance methods for generating stub-functions for non-functional/disabled media plugin interfaces
(i.e. functions that invoke a provided error callback or log the error, see docs)
* update/set field mediaManager.plugins[i].disabled in case plugin reports that it is non-function/disabled
* mediaManager and env/media/<audio-input-plugins>: added (optional) interface methods for audio-input-plugins (i.e. speech recogntion plugins)
* `destroyRecogntion: (successCallback?: (didDestroy: boolean) => void,failureCallback?: Function) => void`: destroys speech recognition instance
* `initializeRecogntion: (successCallback?: (didInitialize: boolean) => void,failureCallback?: Function) => void`: re-initialized speech recognition instance
* the success callback for speech recognition (i.e. for `recognize(..)`, `startRecord(..)`, `stopRecord(..)`) now supports an optional fifth argument `custom`:
the argument is dependent on the ASR engine / plugin, that is, a specific implementation may return some custom results via this argument
* mediaManager and env/media/<audio-output-plugins>: added (optional) interface methods for audio-output-plugins (i.e. speech synthesis plugins)
* `destroySpeech: (successCallback?: (didDestroy: boolean) => void,failureCallback?: Function) => void`: destroys speech synthesis instance
* `initializeSpeech: (successCallback?: (didInitialize: boolean) => void,failureCallback?: Function) => void`: re-initialized speech synthesis instance
* eventEmitter: support event handlers / hooks for functions set an the thisArgument with "on<event name>",
by setting optional constructor argument enableHooks to true
* configurationManager:
* added optional third argument `emitOnAdding` (`boolean`) for `configurationManager.on()` and `configurationManager.addListener()`:
if `true` immediately fires listener with current value after adding it.
* added converter method `getNumber()` (works analogous to `getString()` and `getBoolean()`)
* configurationManager.set(): now returns the newly set value
* mmirf/events: added extension module mmirf/events/propertyHandler that attaches a function to the EventEmitter class
for creating event handler properties, e.g.
```
var EventEmitter = mmir.require('mmirf/events/propertyHandler');
var emitter = new EventEmitter();
emitter.createEventHandlerProperty('SoundStart');
context.onsoundstart = function(){ console.log('sound has started') };
```
BUGFIX:
* env/media/micLevelsAnalysis:
* fixed compatibility for detecting & invoking getUserMedia(): do handle deprecation of navigator.getUserMedia()
* do handle case that that plugin is non-functional (e.g. due to missing getUserMedia())
##################
Version 6.2.0
##################
MODIFICATION:
* tools/codeGenUtils: added helper tools/codeGenUtils and extracted closure-wrapper functionality for generated code to it (e.g. for generated grammars and views)
* mmirf/parserModule: breaking internal change due to removed constants STORAGE_CODE_WRAP_PREFIX and STORAGE_CODE_WRAP_SUFFIX from mmirf/parserModule, replaced by functions getCodeWrapPrefix() and getCodeWrapSuffix()
* views:
* mvc/view etc: added optional argument disableStrictMode (boolean) to stringify() interface method
* explicitly make generated view-code strict (i.e. JavaScript strict mode)
* increment STORAGE_FILE_FORMAT_NUMBER to 4
* grammars:
* added optional argument option disableStrict (boolean) for generating grammars
* jison-engine: update jison version to 0.4.18 (in order to support JavaScript strict mode)
* explicitly make generated grammar-code strict (i.e. JavaScript strict mode)
* increment GRAMMAR_FILE_FORMAT_VERSION to 7
* languageManager.setLanguage(): now sets changes "language" setting in/with configurationManager.set("language", ...) which will also trigger a configuration change event
* mediaManager.getVoices({details: true}): added property `local?: boolean` in returned `VoiceDetails`, indicating if the voices is locally availabe or only via network connection
* added support for `VoiceDetails.local` in built-in TTS engines `ttsWebspeech` and `ttsMary`
* typings:
* `DialogManager`, `InputManager`: normalized typings by declaring and extending base interfaces `StateManager`
* `DialogEngine`, `InputEngine`: normalized typings by declaring and extending base interfaces `StateEngine`
ADDITION:
* logger: added new optional last argument `reverseCallStack?: number` to all logging/printing function, e.g.
```javascript
debug: function(className, funcName, msg, reverseCallStack)
```
the optional _offset_ when printing the callstack position/information: a positive number will go further back/up the callstack.
This can be used in logging-helper functions to select the invoking function's position from the callstack instead of printing the information of the logging-helper function itself.
* typings:
* added typing for `mmirf/checksumUtils` (interface `ChecksumUtils`)
* added typing for `mmirf/logger` (interfaces `LoggerModule` and `Logger`)
BUGFIX:
* mediaManager: do evaluate options when trying to invoke error-handler for not-implemented functions
* semantic/positionUtils: in _createPosPreProc(), removed undeclared variable sourcePos and fixed handling pos flag for enabling position calculation
* env/media/webMicLevels: do declare local variable db
* env/media/ttsWebspeech: when selecting voice by filter, do ensure that language corresponds to currently selected voice
* logger: shortcut functions (e.g. `d()` for `debug()`) now print the correct invoking function information
* typings:
* do declare constructor for GrammarConverter and IAudio
* fixed declaration for ConfigurationManager.on/.off/.addListener/.removeListener
* fixed typing for NodeMmirModule.init() method
* fixed typing for Grammar: make deprecated field stop_word optional
* fixed typing for MediaManagerPluginEntry: added missing (optional) property `config`
* semantic/grammarConverter: remove undeclared (and unused) variable `replLen` in `removeStopwords()`
##################
Version 6.1.0
##################
ADDITION:
* tools/events:
* extendend method EventEmitter.get() to return list of event types (to which listeners are registered) if no event type argument is given
* added EventEmitter.destroy() method
* env/media/ttsMary: added support for filter options when querying voice list
* env/media: added TTS module "ttsWebspeech" for audiotts that utilizes the HTML5 API SpeechSynthesis for TTS
* usage example in "browser" environment (in configuration.json):
...
"mediaManager": {
"plugins": {
"browser": [
...
{"mod": "audiotts", "config": "ttsWebspeech", "type": "tts"}
...
* tools/resources: added 2nd optional argument isReset (boolean) for mmir.res.init(envParam, isReset) for resetting the resources path to their default value, before (re-) initializing the resources
MODIFICATION:
* util_jquery/toArray: switched implementation from jQuery.makeArray to Array.from due to more universal conversion applicability
(if needed, shim for Array.from is included in vendor libraries)
* tools/parseParamsToDictionary and commonUtils.parseParamsToDictionary():
* refactored params dictionary implementation to handle colliding URL parameter names (e.g. colliding with functions defined on the dictionary object)
* only add URL parameter value as multiple, if the same value was not already specified, e.g. for "?key1=1&key1=1", "key1" will not be treated as multiple
* changed internal (i.e. private) handling for is-mulitiple marker and keys fieldname by adding prefix "_" to the field names
BUGFIX
* logger: correctly parse and apply core.logLevel setting if options object with {logLevel: STRING | NUMBER} is used
* tools/eventEmitter: use correct module IDs "mmirf/util/isArray" and "mmirf/util/toArray" (instead of "mmirf/util//...")
* tools/resources: fix handling for platform/environment specific, detected base-path w.r.t. adjusting the framework base path
##################
Version 6.0.0
##################
The resolution for the acronym MMIR has been changed to _Mobile Multimodal Interaction and Relay_ framework,
to account for the changed focus of the framework:
more precisely, that _Rendering_ is not considered an important part of the framework anymore.
This means, that no new features will be added to the built-in template rendering engine and
is condidred _deprecated_, i.e. support/integration for the built-in rendering engine
may be dropped in one of the future major version updates.
GENERAL NOTE:
Switched mmir-related GitHub dependencies to npm depedencies for mmir packages, e.g.
"mmir-lib": "git+https://github.com/mmig/mmir-lib.git" -> "^6.0.0"
"mmir-tooling": "git+https://github.com/mmig/mmir-tooling.git" -> "^6.0.0"
...
ADDITION:
* semanticInterpreter:
* added applyPreProcessing(..): convenience method for function GrammarConverter.preproc(..)
* replacement for deprecated function removeStopwords(..)
* added function addProcessing(..): convenience method for new function GrammarConverter.addProc(..)
addProcessing(langCode, processingStep, indexOrIsPrepend, callback)
* added isPreProcessPositionsEnabled() and setPreProcessPositionsEnabled(enabled):
for enabling/disabling calculation for position-modifications during pre-processing
DEFAULT setting: enabled
* semantic/stemmer: added option allowUmlauts to allow preventing "normalizing" umlauts
* grammar.json: additional (optional) field "example_phrases" (string | Array<string>) for including example phrases that should be recognized by the grammar
* added commonUtils.getCompiledResourcesIds(..): helper for extracting the ID from compiled resources
* automated support for async grammar execution (in WebWorker):
* fix support for async grammar execution & added support for webpack built
* added configuration setting "grammarAsyncExecMode":
* true: will initialize all compiled grammars for async execution
* Array<string | {id: string, phrase: string}>:
list of grammar IDs (for compiled grammars) that will be initialized for async execution, or
list with entries that MUST have field id (i.e. the grammar ID) and optionally a phrase
that will be executed immediately after initalizing the async-exec grammar
* added optional argument grammarCode for asyncGrammar.init(..): support initializing async-exec grammar by specifying
(JavaScript) grammar-code that will be evaluated withing the async-exec WebWorker (instead of loading compiled grammar)
* added "destroy" functionality to asyncGrammar for terminating its WebWorker (can be restarted by initialing again)
* languageManager.setLanguage(): added optional 2nd parameter doNotLoadResources:
if omitted or TRUTHY will only change current language code, but will not try to load language resources (e.g. dictionary, speech configuration, and grammar), if false will force (re-) loading the language resources
* env/media/audiotts: added support / API function for implementation to supply destroy function via implementing getDestroyFunc(): function(callbackFunc(err|null))
* configurationManager: added on()/addListener() and off()/removeListener() for listening to configuration-value changes
* core.logLevel: additionally allow log-level options object for configuring log-levels
LogLevelOptions: {level?: LogLevel, levels?: {[logLevel: LogLevel]: Array<moduleId>}, modules?: {[moduleId: string]: LogLevel}}
usage example (all fields are optional);
mmir.logLevel = {
level: 'info', //default: "debug"
levels: { // LogLevel -> list of module IDs
3: ['mmirf/notificationManager', 'mmirf/commonUtils'],
verbose: ['mmirf/semanticInterpreter']
},
modules: { // moduleId -> LogLevel
'mmirf/controller': 'verbose',
'webspeechAudioInput': 2
}
};
REFACTOR:
* configurationManager: improved implementation for get(..) and set(..)
* env/grammar/*Generator: extracted common parsing-/generator-functionality into new module mmirf/baseGen
MODIFICATION:
* semanticInterpreter (backwards compatible via module 'mmirf/core4Compatibility'):
* removeStopwords(..): removed un-documented/internal third argument for using custom stopword removal function
* deprecated function removeStopwords(..): should use (new) function applyPreProcessing(..) instead
* use of this function will cause warning message
* grammarConverter (backwards compatible via module 'mmirf/core4Compatibility'):
* modified Positions object: renamed field "str" -> "text", ie.
{text: string, pos: Array<Pos>}
* normalized return values for to return string if computePositions is false, otherwise return Positions object:
removeStopwords(), maskString(), unmaskString(), maskAsUnicode() (and internally: recodeJSON())
* grammarConverter.removeStopwords:
* changed signature: second (optional) in/out argument from positions (Array<Pos>) to computePositions (boolean)
* changed return value: if computePositions is false, return string, otherwise Position
* renamed (internal) field jscc_grammar_definition -> grammar_definition
NOTE: getter-method getGrammarDef() is unchanged
* removed fields from grammerConverter (moved to env/grammar/baseGenerator):
variable_prefix, variable_regexp, entry_token_field, entry_index_field, enc_regexp_str
* removed methods from grammerConverter (moved to env/grammar/baseGenerator):
getCodeWrapPrefix(..), getCodeWrapSuffix(..)
* generalized preproc(..) and postproc(..) for allowing custom pre-/post-processing steps/chains
* added addProc(..), removeProc(..), getProcIndex(..) and field procList for handeling default pre-/post-processing steps as well as custom steps
* added positionUtils with factory methods for wraping functions, e.g. handeling position-modification in pre-/post-processing steps
* preproc(): modified signature preproc(thePhrase, pos, maskFunc, stopwordFunc) -> preproc(thePhrase, pos)
* use addProc(..), removeProc(..) instead of additional/optional arguments maskFunc, stopwordFunc, OR use compatibility mode
* postproc(): modified signature postproc(procResult, recodeFunc) -> preproc(procResult, pos)
* use addProc(..), removeProc(..) instead of additional/optional argument recodeFunc OR use compatibility mode
* grammar.json: deprecated field "stop_word" and "example_phrase"
* deprecated field "stop_word" in JSON grammar format: use field "stopwords" instead
* use of this field will cause warning message
* deprecated field "example_phrase" in JSON grammar format: use field "example_phrases" instead
* mediaManager._fireEvent: deprecated _fireEvent(eventName, argList), should use new method _emitEvent(eventName, ...args) instead
* util_purejs/toArray: using Array.from implementation now instead of custom code (if needed, shim for Array.from is included in vendor libraries)
* REMOVED un-used script env/node/nodeLoadScript.js
* improved compatibility for node environment:
* [BREAKING CHANGE] export extended core module of mmir, instead of a wrapper object
* renamed field mmirLib.config -> mmirLib._config
* renamed field mmirLib.requirejs -> mmirLib._requirejs
* NOTE mmirLib.init() will extend the mmirLib instance itself (which is the extended core instance, see typing of NodeMmirModule)
* [BREAKING CHANGE] removed internal & unused module tools/emma: now included in mmir-plugin-speech-io
BUGFIX:
* mediaManager.stopRecord: FIX default implementation, incorrect parameter-name successCallback -> statusCallback
* grammarConverter.maskAsUnicode:
* added optional argument computePositions (boolean)
* FIX call maskString() with correct signature
* commonUtils.loadImpl(librariesPath, ...): FIX case that librariesPath (string) has not entry in directories.json
* env/grammar/jsccAsyncGenerator: FIX handling of error message from web-worker
* env/grammar/asyncGenerator & workers/*Compiler: FIX relative-path-processing for loading scripts by workers when mmir-lib base URL (core._mmirLibPath) is set to custom path
* env/grammar/jisonGenerator and env/grammar/pegjsGenerator: FIX handling for semantics-variables for phrases and tokens -> must handle as list NOT as dictionary
* env/grammar/jisonGenerator: must manually reset phrase-/token-variables before running grammar/parse
* added missing typings for commonUtils.listDir() and resources.getGeneratedStateModelsPath()
* worker/scionQueueWorker: added compatibility for invoking postMessage in node environment
* env/grammar/asyncCompiler, asyncGrammar, dialog/engineConfig: do correctly register worker.onmessage for browser & node environment (via added tools/asyncUtils)
* [BREAKING CHANGE] do not expect file-names for compiled grammars to have suffix "_grammar.js":
* commonUtils.getCompiledGrammarPath and languageManager.doCheckExistsGrammar: do interpret complete file-name (without extension) as grammar ID (i.e. no name-suffix parsing using "_")
* fix behavior for setting "ignoreGrammarFiles" (Array<string> in configuration.json) and its handling in commonUtils.loadCompiledGrammars(..., ignoreGrammarIds: Array<string>):
removed old-style filtering that would expect suffix "_grammar.js" in generated grammars files when comparing ignore-grammar-IDs with file-names
-> now expects file-names (minus file-extension) to exactly match the grammar IDs (as this is the new naming scheme for generated grammar files since mmir v5.x)
NOTE: this is not backwards compatible for generated grammars files with mmir v4.x
RESOLUTION: recompile grammars with mmir (mmir-tooling) v5.x
* [BREAKING CHANGE] languageManager:
* loadDictionary() and loadSpeechConfig() will not change the current language anymore, use setLanguage() instead
* on setLanguage() only load dictionary and speech configuration if they exists (i.e. if there are corresponding entries in directories.json)
* [BREAKING CHANGE] worker/scionQueueWorker: for consistency, renamed file workers/ScionQueueWorker.js -> workers/scionQueueWorker.js
* [BREAKING CHANGE] core.logTrace: if options object, do treat missing field trace same as default for logTrace, i.e. TRUE (instead of FALSE as before when options object was used)
##################
Version 5.2.0
##################
ADDITION:
* commonUtils: loadScript() now parses for (internal) "require://" protocol and loads require:// resources via require() call instead of using getLocalScript() (which uses <script> tags)
MODIFICATION:
* commonUtils: moved deprecated methods into compatibility module mmirf/core4Compatibility
* getDirectoryContents()
* getDirectoryContentsWithFilter()
* for listDir(pathname: string, filter: RegExp | Function | string):
dropped wild-card support for filter-string, i.e. without core4Compatibility, if (optional second) filter-parameter has type string it is matched against the file-name "as-is", without evaluating wildcards
BUGFIX:
* mediaManager: FIX undeclared var in error-handler when loading plugins
* do include backwards-compatibility module mmirf/core4Compatibility
* FIX typo in module name DialogManager4Compatiblity -> DialogManager4Compatibility
##################
Version 5.1.0
##################
MODIFICATION:
* directories.json: moved generated resource directories.json from /config/directories.json to /gen/directories.json
* mmirf/renderUtils: now renders paths in @style() "as-is" instead of adding path-prefix "content/stylesheets/"
* backwards compatibility: set field stylesRoot on mmirf/parserModule to "content/stylesheets/":
mmir.require(['mmirf/parserModule'], function(parserModule){
parserModule.stylesRoot = 'content/stylesheets/';
// -> @style(file-path) will now get prefixed with 'content/stylesheets/'
...
})
* NOOP: re-formatted source files in accordance to .editorconfig (whitespace & line-break normalization)
ADDITION:
* extended support for custom state models (SCXML definitions):
* in non-WEBPACK build: do add module configuration for compiled state-models (/gen/states/); module-ID is the state model's file name (without extension)
* in WEBPACK build: use mmir's WEBPACK build configuration for setting/overriding the module-ID
##################
Version 5.0.0-rc1
##################
support for webpack-integration and compatibility for running within Node.js
(as well as re-implemented build-tools and Cordova-integration)
NOTE: changes marked with [breaking change | compatibility mode] can be automatically amended by
loading the backwards compatibility module, so that code may use the old v4 API for mmir-lib.
[BREAKING CHANGE]
the sources are now located in directory /lib (instead of project's root)
EXAMPLE for including the v4 backwards compatibility layer (e.g. in app.js):
mmir.ready(function () {
//apply v4 compatibility layer:
mmir.require(['mmirf/core4Compatibility'], function(core4Compatibility){
core4Compatibility(mmir);
//-> ready to use mmir-lib v4 API
});//end of compatibility closure
});//end of mmir.ready() callback
[breaking change | compatibility mode] MODIFICATION:
* env/media: renamed modules for improved consistency; corresponding settings in configuration.json need to be adjusts
* renamed "webAudioTextToSpeech" module to "audiotts"
* in configuration.json: change entries in {"mediaManager": { "plugins": ...
"webAudioTextToSpeech" -> "audiotts"
* renamed "maryTextToSpeech" module to "ttsMary" and its (optional) configuration field "serverBasePath" to "baseUrl"
* in configuration.json: change
{"maryTextToSpeech": { "serverBasePath": ...
to
{"ttsMary": { "baseUrl": ...
* dialogManager: removed helper/shortcut methods that invoke ControllerManager or PresentationManager methods
* methods can be re-attached using dialogManager4Compatibility module (or via core4Compatibility):
mmir.require(['mmirf/dialogManager4Compatibility'], function(dialogCompat){
//re-attache helper/shortcut methods:
dialogCompat(mmir.dialog);
});
* removed methods/functionality (can/should be used via ControllerManager or PresentationManager directly):
* DialogManager.perform(ctrlName, actionName, data) -> ControllerManager.perform
* DialogManager.performHelper(ctrlName, helperActionName, data) -> ControllerManager.performHelper
* DialogManager.showDialog(ctrlName, dialogId, data) -> PresentationManager.showDialog
* DialogManager.hideCurrentDialog() -> PresentationManager.hideCurrentDialog
* DialogManager.showWaitDialog(text, theme) -> PresentationManager.showWaitDialog
* DialogManager.hideWaitDialog() -> PresentationManager.hideWaitDialog
* DialogManager.render(ctrlName, viewName, data) -> PresentationManager.render
* DialogManager.getOnPageRenderedHandler() instead use: PresentationManager.on_<render event name>
* DialogManager.setOnPageRenderedHandler(handlerFunction) instead use: PresentationManager.on_<render event name>
* removed semi-private functions (obsolete now, so no direct replacement/alternative in new implementation):
* DialogManager._setControllerManager(controllerManager)
* DialogManager._setPresentationManager(presentationManager)
* constants: renamed "mmirf/constants" to "mmirf/resources" & mmir.res instead of mmir.const:
* "mmirf/constants" -> "mmirf/resources"
* mmir.const -> mmir.res
* renamed methods for file-names & added optional argument langCode for getting the file-path, instead of only the file-name
* getGrammarFileName() -> getGrammarFileUrl(langCode)
* getSpeechConfigFileName() -> getSpeechConfigFileUrl(langCode)
* getDictionaryFileName() -> getGrammarFileUrl(langCode)
[breaking change | mmir-tooling compatibility] MODIFICATION:
* renamed directory/file for SCXML resources & its config-name:
* NOTE: SCXML files are now pre-compiled to JS and emitted to "/gen/states"
* changes described here are backwards compatible when using mmir-tooling & using pre-compiled SCXML models, that is they are automatically handled by mmir-tooling in a backwards compatible way
* for runtime parsing of SCXML files (i.e. directly loading *.xml during runtime), the files need to be renamed & moved as described below
* moved from directory "/config/statedef" -> "/states"
* renamed file "dialogDescriptionSCXML.xml" -> "dialog.xml"
* renamed file "inputDescriptionSCXML.xml" -> "input.xml"
* renamed config-field "scxmlDoc" -> "modelUri", e.g. replace
mmir.config({config: { 'mmirf/dialogManager': {scxmlDoc: 'all_states/example-view_transitions-dialog-states.xml'});
with:
mmir.config({config: { 'mmirf/dialogManager': {modelUri: 'all_states/example-view_transitions-dialog-states.xml'});
if custom configuration for setting the XML file for inputManager or dialogManager had been used
[breaking change] MODIFICATION:
* controllerManager: for creating FileInfo (i.e. Controller.def): dropped (unused) field fileName and make genPath non-optional field
* controller: constructor argument ctx (context) is now changed to be the instance-constructor (NOTE: usually this is used only internally by the framework)
OLD API:
var ctx = {Application: <constructor>}
var ctrl = new Controller('Application', ctrlDefInfo, ctx);
NEW API:
var ctrl = new Controller('Application', ctrlDefInfo, <constructor>);
i.e. if the Controller constructor was used directly, change old code to something like:
var ctrl = new Controller('Application', ctrlDefInfo, ctx['Application']);
* helper: constructor argument ctx (context) is now changed to be the instance-constructor (NOTE: usually this is used only internally by the framework)
OLD API:
var ctx = {ApplicationHelper: <constructor>}
var helper = new Helper(ctrl, 'ApplicationHelper', ctx);
NEW API:
var helper = new Helper(ctrl, 'ApplicationHelper', <constructor>);
i.e. if the Helper constructor was used directly, change old code to something like:
var helper = new Helper(ctrl, 'ApplicationHelper', ctx['ApplicationHelper']);
* mediaManager plugins: media plugins are now wrapped AMD modules; the new loading mechanism will not handle "old-style" plugins automatically (need to load compatibility layer v4 for using old plugins!)
* mmirf/dictionary: internal usage is replaced with standard Map implementation
* still available as module, but needs to be async-required (first time), i.e.:
mmir.require(['mmirf/dictionary'], function(Dictionary){...
* if browser/execution environment does not support Map by default, a polyfill can be activated using module "mmirf/polyfill" (vendor/lib/es6-map-set-polyfill.min.js):
//after loading <mmirf>/core.js:
mmir.startModules = ['mmirf/polyfill'];
* gen/views: for consistency is now located at gen/view
* when compiling (that is, when views will be re-compiled) the necessary changes/files will be automatically be created
* ... however, the old directory <www>/gen/views (and its files) will not be automatically be deleted; this needs to be done manually
* or, alternatively, the corresponding directory can be renamed manually
----------------------
[non-breaking changes]
MODIFICATION:
* env/media: renamed module/files; the original module/file names are deprecated but will be automatically mapped to the new name
* "cordovaAudioOutput" -> "cordovaAudio"
* "html5AudioOutput" -> "webAudio"
* "webAudioTextToSpeech" -> "audiotts"
* "webttsMaryImpl" -> "ttsMary"
ADDITION:
* commonUtils.loadImpl(): added 4th argument in status-callback holding the (loaded) result
* env/asyncGen: added support for re-initializing async grammar generators after they have been destroyed
* env/asyncGen.destroy(force): added optional argument force; if omitted or false, will wait until a pending jobs have been finished
* languageManager: for fixLang(...), added language code fix for 'google' -> convert 3-letter codes to 2-letter codes
* presentationManager: added helper function PresentationManager._fireRenderEvent() for use in view-engine implementations for emitting rendering events
BUGFIX:
* logger: do allow setDefaultLogLevel() be set with string (in addition to number), e.g. 'debug', 'info', 'warn', 'error'
* env/webspeechAudioInput: do set error-callback correctly in cancelRecognition()
* env/webAudio: do trigger audio's error-callback if play-promise failed
##################
Version 4.2.1
##################
ADDITION:
* languageManager.existsGrammar(): added optional argument grammarType for checking specifically json or js grammar
MODIFICATION:
BUGFIX:
* commonUtils.getCompiledGrammarPath: fix accessing undefined variable librariesPath
* asyncGrammarWorker.addGrammer: must check options for stopwords field
* semantic/grammarGenerator: for executing grammars in WebWorker -> added test for >self< (WebWorker), before setting >global< (Node) as global context in the generated grammar script
##################
Version 4.2.0
##################
FIX:
* env/html5AudioOutput: added mechanism to handle rejected play-promise for new WebAudio-play implementations
* cf. https://developers.google.com/web/updates/2017/09/autoplay-policy-changes
* now event 'errorplay' will be triggered on mediaManager, if play() causes a rejected promise
* basic example for handling:
mmir.media.on('errorplay', function(audio, domException){
const btn = document.createElement('button');
btn.style.position = 'absolute';
btn.style.top = 'calc(50% - 75px)';
btn.style.left = 'calc(50% - 200px)';
btn.style.width = '400px';
btn.style.height = '150px';
btn.style.fontSize = '24px';
btn.style.backgroundColor = 'rgba(255, 200, 200, 0.8)';
btn.innerText = 'Prevented to play audio: Please confirm that audio should be played by clicking here within 10 next seconds!';
//allow user to reject auto-play:
// either provide cancel-option, or something else like "auto-timeout":
var timer = setTimeout(function(){
mmir.media.cancelSpeech();
btn.remove();
}, 10000);
btn.onclick = function(){
clearTimeout(timer);
audio.play();
this.remove();
};
document.body.appendChild(btn);
});
MODFIFICATIONS:
* manager: added multi-client capability
* added support for creating multiple instance of controllerManager, dialogManager, and inputManager
* usage example:
function createClientSession(mmir, globalCtx, options){
var isDebug = options.isDebug;
//create shallow copy of mmir namespace:
var _mmir = mmir.require('mmirf/util/extend')({}, mmir);
return new Promise(function(resolve, reject){
var ctrl = _mmir.ctrl._create();
ctrl.init(globalCtx).then(function(ctrl){
if(isDebug) console.log('**************************** initialized ctrl instance...');
_mmir.ctrl = ctrl;
var dialog = _mmir.dialog._create();
var input = _mmir.input._create();
Promise.all([
dialog.init(false).then(function(dlg){
if(isDebug) console.log('**************************** initialized dialog instance...');
_mmir.dialog = dlg.manager;
_mmir.dialogEngine = dlg.engine;
_mmir.dialog._setControllerManager(ctrl);
}),
input.init(false).then(function(inp){
if(isDebug) console.log('**************************** initialized input instance...');
_mmir.input = inp.manager;
_mmir.inputEngine = inp.engine;
})
]).then(function(){
if(isDebug) console.log('**************************** creating controller instances using separate instances for ctrl, dialog, input ...');
resolve(_mmir);
})
});
});
}
* improved error output for SCION engine
BUGFIX:
* manager/notificationManager: updated implementation for changed cordova vibrate() implementation
##################
Version 4.1.0
##################
MODFIFICATIONS:
* improved node compatibility:
* dialogManager/inputManager: renamed internal logger to _logger (for compatibility with newer SCION libraries)
* scionEngine: added compatibility code for newer SCION lib versions
* grammerEngine/pegjs: use AMD library variant, instead of node-incompatible requirejs shim
BUGFIX:
* grammer/[jscc/jison/peg]Generator: for generating intermediate grammars: need to mask/recode delimiting quote character (i.e. quotes that are used within the intermediate grammar to delimit the token-definition)
* media/webAudioTextToSpeech:
* in legacy textToSpeech-function: must use mediaManager.perform() instead of this-reference
* handle "play silence" correctly: must return TRUE on play(), since silence did start immediately (i.e. delay due to loading resources etc)
* semanticInterpreter: in sync-compile fallback, must use mmirf/<modoule> instead of only <module> for loading
* dialog/engineConfig:
* save access window/global object
* consistently access Worker (through window/global object)
* stub-factory impl.: invoke gen in context of engine-instance
##################
Version 4.0.1
##################
MODFIFICATIONS:
* REFACTOR [breaking change] languageManager: removed setNextLanguage
use mmirf/core3Compatibility for restoring this functionality to languageManager
* ADD mmirf/util/extendDeep for deep-copy/cloning of objects (equal to jQuery syntax/API)
* IMPROVE AudioOutput implementations: revoke/release generated data-URLs upon resources-release
BUGFIX:
* mmir.present: fixed to documented reference name mmir.present (instead of mmir.presentation)
* webAudioTextToSpeech: added existence-check before invoking release() for an audio-object, since code might get triggered asynchronously after audio-object has already been removed
* webspeechAudioInput: non-functional dummy plugin implementation
* BUGFIX var typo in cancelRecognition() impl.
* FIX evaluate options object (if present
* mmir.util: fixed checkNetworkConnection(): check all necessary fields/classes before assuming that Cordova network-information plugin can be used for checking the network status
* webAudioTextToSpeech: do release audio resources in single-sentence mode (not only in multiple-sentence mode)
##################
Version 4.0.0
##################
----------------- [starter-kit backward compat settting] -----------------
index.html: add jQuery, e.g. v2 or v3
<script type="text/javascript" src="jquery-2.2.3.js"></script>
preinit.js:
change paths -> remove leading '../' from requirejs module-ID declarations
app.js:
mmir.ready(function () {mmir.require(['core3Compatibility'], function(core3Compatibility){
...
});
----------------- [starter-kit backward compat settting] -----------------
----------------- < Migration Guide > -----------------
> see also migration resources at (T.B.D.)
> https://github.com/mmig/mmir-migration/
update build-resources:
* replace build/ directory with new mmir-tooling resources
* follow the instructions of the mmir-tooling README, or for short:
* install gulp-cli (`npm install -g gulp-cli`)
* execute `npm install` in build/
* run `gulp` in build/
update web-resources:
* replace <web resources>/mmirf/ directory with new mmir-lib resources
* delete <web resources>/gen/ directory
* if the app uses require():
due to the changed baseUrl configuration, the paths may have changed:
instead of require('../appjs/some-script') [OLD]
use require('./appjs/some-script') [NEW]
or require('appjs/some-script') [NEW]
* if the app uses jQuery:
jQuery does not ship with mmir-lib anymore, i.e. needs to added separately, if it is required
(e.g. insert <script> for jQuery in index.html)
* if the app uses jQuery Mobile:
jQuery Mobile does not ship with mmir-lib anymore, i.e. needs to added separately, if it is required
(e.g. insert <script> and <link> for jQuery Mobile and its styles in index.html)
* dealing with changed API:
1) use compatibility module(s):
(a) if the app does NOT require() mmir-lib modules, simply extend mmir.ready() callback (e.g. in app.js):
mmir.ready(function () {
//add compatibility closure:
mmir.require(['mmirf/core3Compatibility'], function(core3Compatibility){
core3Compatibility(mmir);
...<old code>
});//end of compatibility closure
});//end of mmir.ready() callback
(b) if the app DOES require() mmir-lib modules, extend mmir.ready() callback, and first add old module-ID compatibility (e.g. in app.js):
mmir.ready(function () {
//add compatibility closure:
mmir.require(['mmirf/core3ModuleIdCompatibility', 'mmirf/core3Compatibility'], function(core3ModuleIdCompatibility, core3Compatibility){
core3ModuleIdCompatibility(mmir.require, window);
core3Compatibility(mmir);
...<old code>
});//end of compatibility closure
});//end of mmir.ready() callback
2) change app code according to [breaking change] comments (see below)
-------------------------------------------------------
MODFIFICATIONS:
* REFACTOR [breaking change] removed dependency on jQuery
* removed jQuery library (i.e. does not "ship" with mmir-lib anymore)
* added util-implementations that either use jQuery (if present) or use an alternative implementation, see tools/util_purejs/ and tools/util_jquery
* replaced jQuery dependencies with specific function-dependencies (of utility functions), e.g. util/deferred, util/extend etc
* detect jQuery presence and use its implementation when present (see mainConfig and core)
* REFACTOR [breaking change] removed dependency on jQuery Mobile
* removed jQuery Mobile library and its styles (i.e. does not "ship" with mmir-lib anymore)
* set default view-engine to mmirf/simpleViewEngine (that has no additional dependencies)
* extracted jqmViewEngine (jQuery Mobile-based) to separate component, that can be used instead of the new default view-engine
* REFACTOR [breaking change] mainConfig: set baseUrl to './' for requirejs (instead of './mmirf')
* if requirejs was not used in application code, nothing changed
* NOTE for external use of requirejs (in application code):
the base-path/-URL for require-ing scripts is now now the www-root, e.g.
instead of require('../appjs/some-script') [OLD]
use require('./appjs/some-script') [NEW]
or require('appjs/some-script') [NEW]
* REFACTOR [breaking change] renamed requirejs module IDs by using prefix "mmirf/" in module IDs now
* if code did not use require() for accessing mmir-lib modules, nothing changed
* in old code that require()'ed mmir-lib modules, add prefix "mmirf/" to module ID,
example 1:
instead of require('presentationManager') [OLD]
use: require('mmirf/presentationManager') [NEW]
example 2:
instead of require('grammarConverter') [OLD]
use: require('mmirf/grammarConverter') [NEW]
* MODIFY [breaking change] changed core modules in mmir namespace to shorter names
* removed deprecated getInstance() from
* mmirf/constants
* mmirf/controllerManager
* mmirf/dialogManager
* mmirf/inputManager
* mmirf/mediaManager
* mmirf/modelManager
* mmirf/notificationManager
* mmirf/presentationManager
* mmirf/parseUtils
* mmirf/renderUtils
* mmirf/semanticInterpreter
* RENAME shorter module names in core/mmir:
* mmir.ConfigurationManager -> mmir.conf
* mmir.ControllerManager -> mmir.ctrl
* mmir.PresentationManager -> mmir.present
* mmir.DialogManager -> mmir.dialog
* mmir.DialogEngine -> mmir.dialogEngine
* mmir.InputManager -> mmir.input
* mmir.InputEngine -> mmir.inputEngine
* mmir.CommonUtils -> mmir.util
* mmir.LanguageManager -> mmir.lang
* mmir.MediaManager -> mmir.media
* mmir.SemanticInterpreter -> mmir.semantic
* mmir.ModelManager -> mmir.model
* mmir.Constants -> mmir.const
* mmir.NotificationManager -> mmir.notifier
* MODIFY Constants: removed getter for plugins directory path (see also comments below for auto-loading mechanism of plugins)
* REMOVE: getPluginsPath()
* MODIFY SemanticInterpreter:
* renamed: getASRSemantic -> interpret
* MODIFY MediaManager:
* renamed: textToSpeech -> tts
NOTE: textToSpeech() is still available as deprecated
* MODIFY PresentationManager:
* renamed: renderView -> render
* MODIFY ControllerManager:
* renamed: getController -> get
* renamed: getControllerNames -> getNames
* MODIFY ModelManager:
* renamed: getModel -> get
* renamed: getModels -> getNames
* MODIFY ConfigurationManager: removed deprecated methods
* REMOVE: getLanguage() : STRING
* REMOVE: setLanguage(STRING)
* CHANGED signature for get(), getBoolean(), and getString():
[OLD] function(propertyName, useSafeAccess, defaultValue)
[NEW] function(propertyName, defaultValue, useSafeAccess)
* MODIFY CommonUtils: removed compatibility-mode function (use separate module mmirf/core2Compatibility instead)
* REMOVE: setToCompatibilityMode()
* REMOVE: loadAllCordovaPlugins()
* MODIFY LanguageManager: removed compatibility-mode function (use separate module mmirf/core2Compatibility instead)
* REMOVE: setToCompatibilityMode()
* REMOVE [breaking change] of internal module scionEngine: created SCION engines do not have a getInstance method anymore
(since this module is only used internally, as well as the created instances, the change have no effect on application code)
* MODIFY [breaking change] semanticInterpreter / grammarConverter:
* MODIFY increased GRAMMAR_FILE_FORMAT_VERSION to 5 (new file format for compiled grammars)
* MODIFY when registering compiled grammars, add stopwords via options (instead of separate function call)
* REMOVE deprecated functions / fields
* semanticInterpreter.getASRSemantic_alt()
* semanticInterpreter.removeStopwords_alt()
* grammarConverter.stop_words_regexp_alt()
* grammarConverter.parseStopWords_alt()
* grammarConverter.getStopWordsRegExpr_alt()
* ADDITION grammarConverter: added functions preproc() and postproc() that are executed on the input-string before and after applying a grammar (i.e. pre-processing and post-processing of the input-string in semanticInterpreter.interpret())
* prepoc(): pre-processing of input-string, before applying grammar
* postpoc(): post-processing of input-string, after grammar was applied (i.e. on semantic-result)
* MODIFY changed signature for grammarConverter.maskString():
old signature: (str: STRING[, prefix: STRING, postfix: STRING]) -> STRING
new signature: (str: STRING[, computePositions: BOOLEAN, prefix: STRING, postfix: STRING]) -> STRING | {str: STRING, pos: ARRAY<POSITION>}
* MODIFY changed signature for grammarConverter.unmaskString():
old signature: (str: STRING[, detector: RegExp]) -> STRING
new signature: (str: STRING[, computePositions: BOOLEAN, detector: RegExp]) -> STRING | {str: STRING, pos: ARRAY<POSITION>}
* MODIFY jsccGenerator / jisonGenerator / pegjsGenerator:
changed format of semantic-results (i.e. results of applying a grammar):
* field phrases is now a list of tokens/utterances (instead of a map/dictionary)
* phrases contain position information for the tokens / utterances
* in list of field phrases: the tokens / utterances entries have additional type field
* additional field preproc: contains information on pre-processing w.r.t. to the semantic-result
* has property stopwords, which is a list of position-information of all removed stopwords
* REFACTOR grammarConverter: moved/extracted (deprecated) umlaut-encoding functions to separate utils-module
* added new encoding-utils module 'encodeUtils'
* moved functions from grammarConverter to encodeUtils:
* encodeUmlauts
* decodeUmlauts
* REMOVE [breaking change] deprecated methods from presentationManager (not restored with core3Compatibility module):
* reRenderView(): use renderView() with corresponding arguments instead
* renderPreviousView(): use renderView() with corresponding arguments instead
* REMOVE [breaking change] legacy directory plugins/ and its auto-load function were removed (not automatically restored with core3Compatibility module):
the plugin-directory was used for auto-loading Cordova 2 plugins. Since Cordova 3, the
Cordova framework has its own loading mechanism.
If this directory was used in applications, for auto-loading JS files, the functionality
can be replaced by using a list/array of file names (the list needs to be maintained
manually though), and using the function loadImpl() (e.g. require('mmirf/commonUtils').loadImpl())
* For restoring auto-loading of (Cordova/cutom) plugins "manually":
* configure mmir-tooling to create a file-list for the plugins-directory:
open file mmir-build.properties (in project root directory) and modify the entry for directoriesToParse
by adding the plugins directory (relative to the www-root), e.g. for (the original) "mmirf/plugins":
directoriesToParse=<...>,gen/grammar,gen/views,mmirf/plugins
* (re-) generate the file list, e.g. by invoking "cordova prepare"
* load the 'mmirf/core3Compatibility' module, and invoke mmir.CommonUtils.loadAllCordovaPlugins(pluginDir, completionCallback)
where pluginDir is the same (relative) directory path, that was added to directoriesToParse, and
completionCallback is (an optional) callback, that is invoked after the plugins were loaded.
* ADDITION added function/module 'mmirf/core3Compatibility' for restoring backward-compatibility to mmir-lib v3 (except for changed module IDs, see below), e.g.:
mmir.ready(function () {
require(['mmirf/core3Compatibility'], function(setCore3Compatibility){
setCore3Compatibility(mmir);
//... -> restored compatibility with pre v4
* ADDITION added function/module 'mmirf/core2Compatibility' for restoring backward-compatibility to mmir-lib v2 (except for changed module IDs, see below), e.g.:
mmir.ready(function () {
require(['mmirf/core2Compatibility'], function(setCore2Compatibility){
setCore2Compatibility(mmir);
//... -> restored compatibility with pre v3
* ADDITION added function/module 'mmirf/core1Compatibility' for restoring backward-compatibility to mmir-lib v1 (except for changed module IDs, see below), e.g.:
mmir.ready(function () {
require(['mmirf/core1Compatibility'], function(setCore1Compatibility){
setCore1Compatibility(mmir);
//... -> restored compatibility with pre v2
* ADDITION added function/module 'mmirf/core3ModuleIdCompatibility' for restoring backward-compatibility w.r.t. changed module IDs, e.g.:
(NOTE if used in combination with mmirf/core1Compatibility, or mmirf/core2Compatibility, or mmirf/core3Compatibility, then the mmirf/core3ModuleIdCompatibility module should be used first)
mmir.ready(function () {
require(['mmirf/core3ModuleIdCompatibility'], function(core3ModuleIdCompatibility){
core3ModuleIdCompatibility(core.require, window);
//... -> can use old module IDs as aliases for new ones, e.g. require('languageManager') instead of / in addition of require('mmirf/languageManager')
* MODIFICATION grammarConverter: recodeJSON() now re-calculates token indices in semantic results (if position information is present for them)
* MODIFICATION jsccGenerator / jisonGenerator / pegjsGenerator: error messages contain error-stack (if available)
* MODIFICATION workers/jsccCompiler / workers/jsccCompiler / workers/jsccCompiler: error messages contain error-stack (if available)
* MODIFICATION mediaManager / ASR plugins: added options parameter to recognize(), startRecord(), and stopRecord() as optional first parameter
* MODIFICATION mediaManager / TTS plugins: normalized options parameter (or text/text-array parameter) for tts() as first parameter
* REFACTOR removed deprecated tools/envInit (not needed anymore)
* REFACTOR presentationManager: extracted view-loading and -compilation from presentationManager into separate module env/view/viewLoader
* ADDITION mmir/core:
* added field version that holds version number (as String) of the mmir-lib
* added method isVersion(ver: String, comparator: ">=" | "<=" | ...)
* ADDITION tools/constants: added function isCordovaEnv()
* IMPROVE tools/loadCss: enable setting 'class' and 'data-' attributes, if provided in options
BUGFIX:
* BUGFIX tools/commonUtil: fix BUG in case the duplicate-detection-callback marks the last file as 'duplicate' (in serial-loading-mode): loading did not signal "finish" in this case
* BUGFIX mvc/contentElement: fix for stringify(): correctly include initEvalFunctions() in stringified init() function if needed
##################
Version 3.7.7
##################
MODFIFICATIONS:
* MODIFICATION env/media/webMicLevels: emit RMS value in addition to dB value
* ADDITION vendor/lib: added modified version of scion library (non-minified)
##################
Version 3.7.6
##################
MODFIFICATIONS:
* MODIFICATION env/media/webspeechAudioInput.js: enabled (optional) intermediate-results argument for recognize()
* MODIFICATION env/media/webAudioTextToSpeech: improved error handling
* IMPROVE env/media/webMicLevels: improve calculation for RMS and dB
* FIX env/media/webspeechAudioInput: replace internal "loglevel + console.log" mechanism with logger
BUGFIX:
* BUGFIX core: for queuing/dequeuing ready() callbacks
* BUGFIX manager/notificationManager: check availability of fireError before usage (if there was an error during initialization, this function might not be available)
* BUGFIX env/media/webAudioTextToSpeech.cancelSpeech(): only call success-callback, if one is present
##################
Version 3.7.5
##################
MODFIFICATIONS:
* ADDITION core.js: added property mmir._mmirLibPath which allows to set the (relative) path to the mmir-lib (if it is different than the default path mmirf/); DEFAULT VALUE: undefined
* ADDITION tools/constants.js: allow manual configuration via requirejs' config() of basePath:
usually the basePath is automatically detected depending on platform/environment, but in case the mmir-lib
but in case the mmir-lib and the framework files (controllers, views etc) are located somewhere different
than the default location, the this configuration can be used:
Example
[before the framework initializes: set base-path to resources (controllers, models etc.) to assets/]
mmir.config({config: {'constants': {
basePath: 'assets/'
}}});
* ADDITION presentationManager.js: added configuration value defaultLayoutName for setting a custom default-layout (or disabling the default-layout, in case a FALSY-value other than undefined is set)
Example (in config/configuration.json): disabling default value
{
...
"defaultLayoutName": null,
...
}
Example (in config/configuration.json): use views/layouts/custom.ehtml as default layout
{
...
"defaultLayoutName": "custom",
...
}
* MODIFICATION tools/commonUtils.js: getDirectoryContents() is now an alias for getDirectoryContentsWithFilter(), both with optional second parameter
* REFACTOR tools/commonUtils.js: renamed functions (and made old name depricated):
* getDirectoryContents() -> listDir
* getDirectoryContentsWithFilter() -> listDir
* REFACTOR normalized use of Promises/jQuery.Deferred: always use Promise/A+ standard then() function (instead of jQuery alternatives like done(), fail(), always() etc)
BUGFIX:
* BUGFIX env/media/jqmViewEngine.js: use basePath for loading CSS stylesheet
* BUGFIX tools/constants.js: prepend basePath to worker's sub-path
* BUGFIX presentationManager.js: abort, if on rendering a view cannot be found
* BUGFIX controllerManager.js: handle case that no (default) layout is present without provoking an exception
* BUGFIX tools/commonUtils.js: in getDirectoryContentsWithFilter() and getDirectoryContents() do wildcard matching without RegExpr, in order to avoid potential problems with special regex-characters in filenames
* BUGFIX fixed wrong use of jQuery.Deferred.fail(), when reject() should be used
##################
Version 3.7.4
##################
MODFIFICATIONS:
* ADDITION main.js: exports now the mmir object in its module definition, i.e. you can use: require('main') for retrieving mmir core
* REFACTOR controller.js, helper.js: renamed (internal) field 'script' -> 'impl', and marked 'script' field as deprecated
* ADDITION mediaManager: added short-cut functions play() (for playWAV() and playURL()) and getAudio() (for getWAVAsAudio() and getURLAsAudio())
* REFACTOR mainConfig.js: all module IDs and their (file) paths are now contained (statically) in mainConfig.js::mmir_config.paths (now, the only mmir framework related module IDs that are added dynamically, as aliases to existing module IDs/paths)
* REFACTOR MmirTemplateLexer: removed dependency of require() (using attached field to lexer class instead)
* REFACTOR template parsing: moved paser/lexer class extensions from templateProcessor to templateParseUtils
* attach templateProcessor's augment-function to template lexer class
* REFACTOR templateProcessor:
* in class extension: replaced (hidden/private) closure variable with this-reference
* export augment/extend-function instead of object for augmenting/extending
* ADDITION attached requirejs' define to core-object as <core module instance>._define (i.e. mmir._define)
* REFACTOR added require() as explicit dependency
* REFACTOR use require/define functions attached to the core-object instead of global-object
* ADDITION contentElement: allow usage of template-variables without prefixing them @ within javascript code
* implement "import" / "export" for data argument that makes the template variables accessible
* "auto declare" variables in for(in)-expressions as template variables if necessary
* when parsing ContentElements from template text, add/use reference to parent ContentElement (if they are not directly contained in a view, but in another ContentElement)within js code
* REFACTOR [parsingResult, templateRenderUtils, contentElement] changed creation of script-eval functions:
instead of creating each function on its own and import & exporting data-vars, now all script-eval functions are gathered and are created within a closure together with the data-vars
BUGFIX:
* FIX MmirTemplateLexer: removed lexing for string-types (which is only relevant within content/scripts lexers)
##################
Version 3.7.3
##################
MODFIFICATIONS:
* ADDITION: added a Controller-argument to initialization constructor for controller (and helper) implementations.
For example, for the controller implementation in file application.js, this argument is passed to the constructor function:
...
var Application = function ApplicationConstructor(ctrl){
this.ctrlRef = ctrl;
...
};
...
NOTE that during the initialization (i.e. in the controller/helper implementation's constructor) there should
be made no calls to the Controller/Helper object, since it is not fully initialized during that time.
* ADDITION added optional context configuration for controller (and helper) implementations and for model implementations:
set these contexts/namespaces in config/configuration.json:
...
"controllerContext": "some.namespace",
"modelContext": "some.other.namespace",
...
this would mean that, for example, the implementation for the controller application.js should be done in namespace
some.namespace, i.e. in application.js:
...
some.namespace.Application = function ApplicationConstructor(){
...
NOTE that these contexts/namespaces are created during intialization, before the controllers/helpers/models are
initialized. If you are using these contexts/namespaces in your own code, you should take care not to
"override" them.
* env/media/webkitAudioInput.js
* REFACTOR renamed file to webspeechAduioInput.js (and module name to "webspeechAudioInput")
* added auto-configuration to mediaManager for backwards compatibility (i.e. "webkitAudioInput" configuration will be automatically mapped to the new module name "webspeechAudioInput")
BUGFIX
* env/media/webkitAudioInput.js: avoid ReferenceErrors when checking for SpeechRecognition implementation in browsers other than Chrome
##################
Version 3.7.2
##################
MODFIFICATIONS:
* updated jQuery to version 2.2.3
* updated jQueryMobile to version 1.4.5
* IMPROVED JavaScript "strict" conformance: avoid re-defining variables
* semantic/grammarConverter.js, manager/presentationManager.js
* REFACTOR tools/dictionary.js: replaced delete statements with undefined-values (avoid changing underlying class structure)
* REFACTOR tools/commonUtils.js: loadScript is now "synonymous" with getLocalScript (i.e. removed "similar" implementation and invoke getLocalScript instead)
* REFACTOR media/env/webkitAudioInput.js:
* extracted microphone-levels analysis for web audio input into separate module / plugin
* microphone-levels analysis can be loaded as plugin via MediaManager.loadFile('webMicLevels.js', ....
* the this plugin should be loaded as "singleton": before loading, check if property MediaManager.micLevelsAnalysis already exists
* the exported functions are then available at MediaManager.micLevelsAnalysis.<exported function>
BUGFIX
* manager/dialog/engineConfig.js: use equality check instead of assignment statement in if condition
* manager/mediaManager.js: for ReferenceError in loadFile(): fixed typo for argument name
* env/media/webAudioTextToSpeech.js: added handling in case loading the specific TTS implementation fails
##################
Version 3.7.1
##################
MODFIFICATIONS:
* REFACTORING in env/media:
* extracted common-code for web-audio based modules into modules webAudioTextToSpeech.js and webAudioInput.js
* moved language-code modifications (as required by specific TTS and/or ASR modules) into LanguageManager instead of requiring specific configuration files
* specific impl. for web-audio TTS and ASR modules can be configured in config/configuration.json via the "config" property,
for example (note the "config" property for the webAudioTextToSpeech.js entry):
"mediaManager": {
"plugins": {
"browser": ["html5AudioOutput.js",
{"mod": "webAudioInput", "config": "webasrGooglev1Impl"},
{"mod": "webAudioTextToSpeech.js", "config": "webttsNuanceImpl"}
],
"cordova": ["cordovaAudioOutput.js",
"androidAudioInput.js",
"androidTextToSpeech.js"
]
}
}
NOTE that a backwards compatible conversion is provided for existing standard modules (e.g. for maryTextToSpeech.js):
old configurations will continue to work for these without changing the configuration.json
BUGFIX
* mainConfig.js: refactored shims for view-parsing by making use of imported dependencies explicit (via init-argument name)
* manager/dialog/engineConfig.js:
* fix error for ios platform
* always try to use WebWorker based command-queue for Dialog-/InputEngine, and only try to use (cordova) QueuePlugin if it actually available
* manager/presentationManager.js:
* avoid ReferenceErrors in case there is no URL for the precompiled view during up-to-date check
* tools/checksumUtils.js:
* avoid setting empty crypto-instance in case global CryptoJS is not available
* mvc/parser/parsingResult.js: added private helper for setting the core-parser namespace (needed when running in nodejs)
##################
Version 3.7.0
##################
API Changes:
* REFACTORING in semantic/GrammarConverter.js
* renamed GrammarConverter.getJSCCGrammar() -> GrammarConverter.getGrammarDef()
* renamed GrammarConverter.setJSCCGrammar(str) -> GrammarConverter.setGrammarDef(str)
* renamed GrammarConverter.getJSGrammar() -> GrammarConverter.getGrammarSource()
* renamed GrammarConverter.setJSGrammar(str) -> GrammarConverter.setGrammarSource(str)
* REFACTORING in tools/commonUtils: (re-)moved functions from commonUtils to (optional module) jsonUtils:
* load jsonUtils with mmir.require('jsonUtils')
* extended CommonUtilsCompatibility with functions from jsonUtils
* moved funcitons from commonUtils -> jsonUtils:
* toJSONStringValue()
* convertJSONStringValueToHTML()
* convertJSONStringToHTML()
* ADDITION MediaManager: additional utility function createEmptyAudio()
* MODFICATION env/html5AudioOutput: getWAVAsAudio() now immediately returns an audio object (not just only via callback)
MODFIFICATIONS:
* IMPROVEMENT for media/env/recorderExt.js: Recorder.forceDownload() audio: added support for FireFox
* mvc/parser/templateRenderUtils.js: use Logger instead of console-output
* MODFICATION using new QueuePlugin (for Android environments with Android version < 4.4):
the API did not change, but most notably, the queue-plugin is now available at window.cordova.plugins.queuePlugin instead of window.plugins.queuePlugin
* ADDITION added implementation for asynchronous compilation & execution of grammars
* ADDITION added configuration value "ignoreGrammarFiles" for application's www/config/configuration.json:
list of language codes / IDs to ignore, i.e. not to load, the (compiled) grammar files for (during start-up)
Example:
"ignoreGrammarFiles": ["de", "ja"],
will not load/compile grammars for languages de and ja
* ADDITION in tools/envDetect.js (env module): added property 'platform' with detected platform (currently only for cordova env: 'android' | 'ios' | 'default')
* ADDITION in tools/constants.js
* added function getEnv(): returns the env-parameter (e.g. 'cordova' or 'browser' or custom value from document's query-param "?env=VALUE")
* added function getEnvPlatform(): returns detected platform (currently only for cordova env: 'android' | 'ios' | 'default')
* MODIFICATION manager/mediaManager.js and the app's /www/config/configuration.json: allow platform specific media-plugin configurations
if the configuration.json contains a specific plugin-config-entry then this media-configuration will be used,
for example, for settings in configuration.json:
"mediaManager": {
"plugins": {
"browser": ["html5AudioOutput.js",
"webkitAudioInput.js",
"maryTextToSpeech.js"
],
"cordova": ["cordovaAudioOutput.js",
"sphinxAudioInput.js",
"sphinxTextToSpeech.js"
],
"android": ["cordovaAudioOutput.js",
"androidAudioInput.js",
"androidTextToSpeech.js"
],
"ios": ["cordovaAudioOutput.js",
"nuanceAudioInput.js",
"nuanceTextToSpeech.js"
]
}
}
then on an Android device, by default the "android" entry will be used, and on an iOS device, the "ios" entry
(and for all other cordova platforms, the "cordova" entry will be used)
* MODIFICATION manager/mediaManager.js and the app's /www/config/configuration.json: allow (optional) config parameter in media-plugin configurations
in the configuration.json's media plugin configuration, the plugin's settings/config-parameters can now be made directly
for example, instead of :
"maryTextToSpeech": {
"baseSeverUrl": "https://some.url"
},
"mediaManager": {
"plugins": {
"browser": ["html5AudioOutput.js",
"webkitAudioInput.js",
"maryTextToSpeech.js"
],...
}
}
you can use an abbreviated configuration by including the "maryTextToSpeech" configuration directly:
"mediaManager": {
"plugins": {
"browser": ["html5AudioOutput.js",
"webkitAudioInput.js",
{"mod": "maryTextToSpeech.js", "config": {
"baseSeverUrl": "https://some.url"
}}
],...
}
}
In addition, the file-extensions for the media modules are now optional and can be omitted in configuration.json:
for example, instead of "webkitAudioInput.js" you can use "webkitAudioInput"
* core.js:
* MODIFICATION the core-module now allows presence of global mmir variable: if one is present upon initialization of the core, then all (non-inherited) properties will be preserved by copying them to the core's global mmir variable (NOTE: excluding properties that would overwrite somehting on the core's mmir object)
* ADDITION of property "mmirName" on core-module (value: "mmir", can be overwritten by defining a global String variable MMIR_CORE_NAME before core-module's core.js is loaded, e.g. see example index.html in starter-kit)
BUGFIX
* tools/loggerDisabled.js: corrected function name: iVerbose -> isVerbose
* tools/logger.js: print correct call-location (from call-stack) for error()-logging
* mvc/parser/templateRenderUtils.js: do not omit non-String results from helper-invocations: instead print warning and "convert" to String
* manager/settings/languageManager.js: in getLanguageConfig() actually apply modification in case a separator was provided
* manager/settings/configurationManager.js: fixed set(): generating new property-objects (i.e. missing components in "settings-path") works now
* manager/mediaManager.js: if modules are loaded into a specific context, and it set to the default-context, then the default-implementation of speech-input/-output functions will now invoke the corresponding functions of the default context
* env/media/html5AudioOutput: fix for getWAVAsAudio() by invoking callback in context of created AudioObject
* env/media/webkitAudioInput:
* fixed result-type to use FINAL in recognize() invocation
* replaced deprecated MediaStream.stop() call, instead: stop all media tracks individually
* improve stopping the audio-analysis (for determining mic-levels): avoid continuing audio-analysis (and keeping microphone open), even in case ASR did stop "un-commonly"
* cancel audio-analysis (for firing mic-level changes) in case recognition was canceled before audio-stream for analysis became available
* use new function-signature (with event-type "RECORDING_DONE") when triggering "manual" stop
* core.js: fix for merging requirejs config-settings -> fixed BUG in case additional, previously non-existing config-values are applied: this caused ANY existing config-value to be overwritten
* mvc/parser: store non-default functions for template-elements (e.g. for ELSE: need to store non-default getEnd()-function in owning IF-element)
* semantic/asyncGrammar.js: explicitly deal with dependency on commonUtils.init()
* workers/ (web-workers):
* BUGFIX deal with case that WebWorker implementation of the environment does not provide console object
* BUGFIX deal with absolute URLs in importScripts()
##################
Version 3.6.0
##################
API Changes
* MODIFICATION: location for silenceDetection.js changed: moved from /mmirf/env/media to /mmirf/workers
currently this file is un-used; for old implementations, change setting in configuration.json:
{
...
"html5AudioInput": {
...
"silenceDetectorPath": "mmirf/workers/silenceDetection.js", //old value: "mmirf/env/media/silenceDetection.js"
...
}...
* MODIFICATION: externalized preparing/wait functionality from media audio-input plugins (prevously in internal/private _wait implementation)
* added property to MediaManger: waitReadyImpl
* if set, then its preparing/ready functions are exported to MediaManager's _preparing/_ready functions, i.e. set object with:
preparing: function(moduleName : String)
ready: function(moduleName : String)
these functions will be called by module implementations when they are preparing (i.e. user should wait) or are ready for further input/processing
* if not set, MediaManager's _preparing/_ready functions are NO-OP functions
* media plugins may invoke preparing/ready functions via MediaManager._prepare(moduleName) and MediaManager._ready(moduleName)
* added implementation for "standalone wait dialog" (extracted wait overlay from jQuery Mobile 1.4.x)
* added media module env/media/waitReadyIndicator.js which "standalone wait dialog" and sets MediaManager's waitReadyImpl property
* changed MediaManager's default modules to include waitReadyIndicator.js (i.e. is loaded by default for the preparing() / ready() implementation)
* ADDITION: mmir.config() now allows setting options for modules
* module settings are merged with default framework settings (previously they were overwritten causing errors if required settings were missing)
* for example can be used for setting specific log-levels:
mmir.config({config: { 'moduleName': {logLevel: 'warn'}}});
* allows to modify settings for dialogManager and inputManager (which currently have required settings in the default settings), e.g. modify log-level:
mmir.config({config: { 'dialogManager': {logLevel: 'warn'}, 'inputManager': {logLevel: 'warn'}}});
or using alternative SCXML definition (overwriting the default setting)
mmir.config({config: { 'dialogManager': {scxmlDoc: 'config/statedef/example-view_transitions-dialogDescriptionSCXML.xml'});
* ADDITION: MediaManager now allows to load multiple modules for same functionality (e.g. two modules for text-to-speech) by using "execution contexts":
example: in configuration.json specify the context for a media module using {"mod": "moduleFile.js", "ctx": "thecontext"},
e.g. the following configuration will load a 2nd speech-input module into context "html"
"mediaManager": {
"plugins": {
"browser": ["html5AudioOutput.js",
"webkitAudioInput.js",
"maryTextToSpeech.js",
{"mod": "html5AudioInput.js","ctx": "html" }
],
...
the 'default module' for speech-input is available - same as before - without the "context prefix" (i.e. the following will use module functions from "webkitAudioInput.js")
mmir.MediaManager.recognize(...
and the 2nd module for speech-input can then be used via its context (this will use module functions from "html5AudioInput.js"):
mmir.MediaManager.ctx.html.recognize(...
see also related functions to this new feature in MediaManager:
* perform(ctx, fname, args)
* getFunc(ctx, fname)
* setDefaultCtx
* ADDITION AudioOutput (HTML5) env/media/html5AudioInput.js:
* the module now provides additional function getWAVAsAudio() analogous to getURLAsAudio()
* except (1): first parameter is a data-blob (instead of an URL)
* except (2): "additional" second parameter for callback: instead of the return-value, the audio-object is passed to the callback (because audio-object creation is potentially asynchronous)
* MODIFICATION AudioInput (HTML5/Webkit) env/media/webkitAudioInput.js:
* in repeat-mode (startRecord()): retry n-times to re-start the recognition for "serious" errors (before giving up an triggering the error-callback)
* ADDITION Recorder (extended) env/media/recorderExt.js:
* provides new semi-public function _initSource(inputSource)
* allows to set new input-source (e.g. in case original input-stream/-source was stopped)
NOTE: this can be useful in order to avoid creating multiple WebWorkers for recording...
* code example:
navigator.getUserMedia({audio: true}, function(stream){
var input = new AudioContext().createMediaStreamSource(stream);
var recorder = new Recorder(input);
//start recording
recorder.record();
...
//stop recording
recorder.stop();
recorder.clear();
//close audio-stream
stream.stop();
...
//restart recorder with another input-stream
navigator.getUserMedia({audio: true}, function(stream2){
var input2 = new AudioContext().createMediaStreamSource(stream2);
//set new input-source on existing recorder:
recorder._initSource(input2);
//start recording
recorder.record();
...
});
});
* ADDITION / MODIFICATION for MARY textToSpeech module env/media/maryTextToSpeech.js:
* an (OPTIONAL) options-object allows to specify a different language and voice (than the current app's settings) when synthesizing text
* NOTE: if you specify a voice which does not exist for the language, an error will be trigger
* example: //specify no callbacks: set onEnd, onError, onInit to NULL
//specify different language and voice in 5th/last arguments
mmir.MediaManager.textToSpeech(text, null, null, null, {
voice: 'bits3-hsmm',
language: 'de'
}
);
* allow empty text: in sentence-mode (i.e. invoking textToSpeech() with an array) empty Strings will be ignored but the sentence-pause will be applied (before, no pause was applied, if an empty string occurred)
* ADDITION the Layout object now provides the additional field headerElements:
* a list of structured data for the parsed SCRIPT, LINK, and STYLE tags in the layout-definition
* see also documentation for Layout.TagElement
New modules for speech input on Android platform via Cordova plugin v0.4.0 (env/media/android*.js)
* added framework integration for Android Speech Plugin (Cordova Plugin)
* NOTE: the Cordova Android Speech Plugin must be installed in the targeted Cordova project first, before the new modules can be used
* added text-to-speech module (android)
* added audio-input module (android)
* use/select the new modules via /www/config/configuration.json, by changing the array-entries in property mediaManager.plugins.cordova, e.g. to
["cordovaAudioOutput.js", "androidAudioInput.js", "androidTextToSpeech.js"]
Media modules (env/media/)
* webkitAudioInput: added normalization-factor for mic-levels (to make values more similar with results from other audio-input plugins)
* maryTextToSpeech:
* added support for "empty sentences" (-> for reading a String-array: an empty String in the array) -> will insert a pause in place of the empty sentence
* added support for using options (language, voice) on funciton-call (instead of/overwriting the app-settings for this call)
* Nuance Speech Plugin (integration code in: env/media/nuanceAudioInput.js):
* suppress start-prompt in sentence-wise input mode
* added option for disabling delayed results (i.e. disabling "improved feedback mode")
* removed files for Speech Plugins in MMIR lib:
* these files are now installed with the corresponding plugin
* removed files for NuanceSpeechPlugin (but will be installed, when plugin is installed):
* env/media/nuanceAudioInput.js
* env/media/nuanceTextToSpeech.js
* removed files for AndroidSpeechPlugin (but will be installed, when plugin is installed):
* env/media/androidAudioInput.js
* env/media/androidTextToSpeech.js
Logger (tools/logger):
* added trace functionality (using stacktrace.js)
* configurable via core.js (see #logTrace)
NotificationManager:
* added implementations for alert() and confirm() for non-Cordova environments
JSDoc
* updated JSDoc comments
* FIX for some incorrect JSDoc comments
* added several comments for enabling Eclipse to detect file structure (e.g. for JavaScript Outline View)
* made comments compatible with JSDoc3 ( >= 3.4.0dev, NOTE: some additional plugins are required for correct (symbolic) link generation)
BUGFIX
* CommonUtils: fixed un-intentional global variable (script)
* in some places (i.e. where this was still missing): explicitly handle / not handle cases where a var is typeof object, but NULL
* AudioOutput, HTML5 (env/media/html5AudioOutput.html):
* correctly register error-listener on Audio object & handle error-callback
* trigger error callbacks with unified error object (same as Cordova AudioOutput error-callbacks)
* PresentationManager:
* need to load/require renderUtils (mvc/parser/templateRenderUtils.js) for stored-views, too (i.e. not only when parsing template-views anew)
* when loading templates/views: if up-to-date check fails, do not load the pre-compiled view (but _only_ the re-parsed/-compiled view)
* Core: BUGFIX for merging additional configurations into the requirejs main-configuration (did omit some additional config-values before)
* maryTextToSpeech: fixed potential error when on playing the requested audio is not available yet
REFACTOR
* some structural (non-functional) changes
* mainly in parserModule, parsingResult, strorageUtils, templateProcessor, renderUtils, paramsParseFunc
##################
Version 3.5.0
##################
Grammar Compilers (env/grammar/)
* added configuration-method for grammar-compiler-options
* for pegjs- and jison-engines
* configuration via configuration.json, e.g.:
"grammar": { "jison": { <jison options> }},
* extended meta-data for grammar result object
* added meta-data 'utterance': name of the matched utterance
* added meta-data 'engine': name of the grammar-compiler that was used to create the grammar
* extended meta-data for 'phrases' entries to include ordering information:
* use object instead of string
* field 'tok': the string that matched the token (as before)
* field 'i': the zero-based index of where in the phrase the token occurs
* MODIFICATION extended detection/acceptance of regular-expressions in jison- and pegjs-engines
* allow optional-operator (?), and multiple-operators (*+) without character-group or grouping
* FIX for conversion of optional-operator in combination with STRINGs
* BUGFIX for partial matching in phrases (helper function _flatten now accepts non-matched parts, e.g. for optional tokens)
* FIX use loggers for compile-error messages (if no custom-function for that was set on the compiler yet); instead of using raw console-output
* BUGFIX for JS/CC compiler: handle errors during compilation (has now same behavior as other engines/compilers)
* extendend jscc-amd API: added functions for getting/checking print-compile-message-functions (print error, print info etc)
SemanticInterperter:
* BUGFIX avoid using generated callback in doGetGrammar
* BUGFIX for getGrammarConverter(ID): do not try to resolve (i.e. load) grammars, if the ID is not registered yet
Template rendering (mvc/parser/templateRenderUtils.js)
* BUGFIX print warning for missing helper result only, if we do not get a string (instead of a FALSY result, as before)
##################
Version 3.4.1
##################
BUGFIXES
* FIXED BUG (and removed HACK for workaround) in PresentationManager.init: removed duplicate declaration of checksumUtils variable
##################
Version 3.4.0
##################
Logging:
* added logger factory
* extended core.js and mainConfig.js for setting up logger factory
* enable / disable logging (through the factory) completely
* set the default log-level
* simplified function for creating a logger for a requirejs module
* uses module's ID as logger-name
* uses module-specific log-level for the module, if defined in requirejs' config (see mainConfig.js for examples)
* FIX removed ("partially" global) variable IS_DEBUG_ENABLED (using logging factory instead)
* TODO add "trace mode" for logger (i.e. log from where the logger functions were called)
* TODO replace console.log() etc with logger calls
PresentationManager:
* added function callRenderEngine: allows to call custom functions on specific implementations of the rendering-engine
MediaManager:
* for use in media-plugins (env/media/)
* added helper for firing / triggering events: _fireEvent(..)
* added support for "observering listeners", i.e. observing registration / removal of event-listeners
* see _addListenerObserver() and _removeListenerObserver()
* notification by callback function with arguments: (eventName, ["added" | "removed"], eventHadlerFunction)
* add aliases for addListener(..) and removeListener(..): on(..) / off(..)
loadCss (tools):
* extended API: now, alternatively, an options-object can be used as arguments; options are added as attributes to the created link
webkitAudioInput (env/media):
* added "mic-levels" / RMS calculation using the microphone input (getUserMedia)
* CHANGED experimental "mic-levels" functionality
* changed API from "polling style" (get...) to "pushing style" (on...)
* removed (experimental) getMicLevels() polling function
* implemented listener-mechanism for event "miclevelchanged"
* uses MediaManager's listener-management (add/remove)
* calculates "change in microphone levels" and notifies registered listeners upon change
* optimization: only open microphone (getUserMedia) if listeners for "miclevelchanged" are registered; close audio from getUserMedia, if there are no listeners for "miclevelchanged" anymore (also handles new registrations / removals during active recognition)
* FIX disable "mic-levels" functionality in case of an "audio-capture" error (some browsers/devices may not support getUserMedia in combination with webkitSpeechRecognition's audio capturing(?))
* FIX recognize function: now creates additional arguments for callback (not just the text-result as before)
* FIX calling callback functions in context of the MediaManager instance
* added some dev-doc-comments
##################
Version 3.3.1
##################
BUGFIX changes to make ANT script mmir-parse.xml work again:
moved requirejs.config for "jqm" and "jqmSimpleModal" to the mainConfig.js again
##################
Version 3.3.0
##################
Modularized the "view engine" from the PresentationManager (no API changes):
the jQuery Mobile based view-engine can now be replaced with some other mechanism more easily.
* extracted all "view engine" code into separate module at mmirf/env/view/jqmViewEngine.js
* removed main dependencies for jQuery Mobile, jQuery Mobile SimpleDialog etc. to new module
* set default view-engine in property on core-module (i.e. global variable mmir):
* property: "viewEngine": "jqmViewEngine"
* TODO: extract template-parsing code into separate module
##################
Version 3.2.0
##################
* updated jQuery to version 2.1.3
* added utility function for loading CSS files (that is: for creating LINK tags), as module "loadCss":
* module impl. at mmirf/tools/loadCss.js
* use by require'ing the module, e.g.: require(['loadCss'], function(loadCss){ loadCss('some.css'); });
* FIX scionEngine
* avoid endless recursion/loop when copying the scion instance with jQuery version >= 2.x
* extended error information
* MODIFICATION PresentationManager
* processing of hook-invocation on Controllers (on_page_load, before_page_load, etc) is handled more gracefully (no error if some parameters are missing)
##################
Version 3.1.1
##################
API CHANGES (additions):
* added (optional) hooks for controllers: "before_page_prepare" and "before_page_prepare_<ctrl name>" which get called before view-templates are prepared for showing (i.e. before dynamic content in views is rendered)
* call-order for hooks is: (1) before_page_prepare*, (2) before_page_load*, (3) on_page_load*
* controller hooks "on_page_load", "before_page_load", "before_page_prepare" are invoked with additional argument viewName (STRING), e.g. on_page_load(data, viewName)
* for controller hooks before_* now the return value is evaluated: if present and false (BOOLEAN), then rendering is aborted, i.e. view will not be rendered
* controller.perform now allows 1 additional argument, e.g. perform('action-name', data, ADDITIONAL_ARG)
* GrammarConverter.loadGrammar: the callback functions are now called in context of the GrammarConverter instance and with additional arguments (e.g. in case of error)
----
* REFACTORED element ID for main pageContainer (in index.html) is now defined as private constant CONTENT_ID (in PresentationManager)
* BUGFIX ConfigurationManager.get: defaultValue is now handled correctly
##################
Version 3.1.0
##################
API CHANGES:
* SemanticInterpreter.getASRSemantic: additional (OPTIONAL) arguement >callback<:
getASRSemantic(phrase, langCode, callback)
the callback is required, if the grammar is not pre-compiled yet (in this case, the grammar
will be compiled, and the ASR semantics will be returned via: callback(result)
----
* changed grammar-generation via JS/CC to lazy-loading
* only load JC/CC if a JSON grammar needs to be compiled (normally, grammars are already pre-compiled)
* added mechanism for allowing use of different grammar-compilers / -engines
* moved code specific for grammar-compilation from SemanticInterpreter to env/grammar/*
* added several grammar-generators for grammar-compilers, including the existing JS/CC-generator (moved the specific code from GrammarConverter to the generator):
available generators: JS/CC (default), Jison, PEG.js
* added config property "grammarCompiler" for setting a specific grammar-compiler (DEFAULT: "jscc"; see SemanticInterpreter.setGrammarEngine() for possible values)
* GrammarConverter
* added JS/CC grammar template as extra file which will be load through AJAX call (instead of unsing a "hard-coded" stringified version in JavaScript code)
* removed grammarParserTemplate.js (which contains the now un-used strigified JS/CC template)
* added a "reduced" template (removed un-used functionality from base-template)
* BUGFIX added RegExp for stopwords that start or end with encoded chars (normal stopword express will not detect these since encoded chars do not match to word-boundries)
* BUGFIX for recodeJSON function: fixed execution context (now the argument recodeFunc will really be exectued in context of the GrammarConverter object)
* SemanticInterpreter
* changed invocation of SemanticInterpreter: add variation that takes a callback function (if a grammar needs to get loaded & compiled, the callback-variant MUST be used the first time that the grammar is used)
* FIX restored mechanism for FILE_FORMAT (was removed in previous commit)
##################
Version 3.0.1
##################
* GrammarConverter
* FIX semantic-object access / processing for nested Utterances/phrases
* MOD grammar generation: use Array (instead of Object) for holding intermediate/partial matches in result Object (i.e. value of field "phrases")
* BUGFIX when unmasking a String: if after masked charater only 1 mcharacter followed, the last character (ie. the one after the masked character) was omitted in the result
* BUGFIX for old/deprecated umlauts encodeding/decoding: file grammarConverter.js had been saved with ACII-encoding (now using escaped unicode chars)
* FIX on masking a String: during generating result-String ("string-buffer"), prevent process from creating unnecessary, empty entries
* MediaManager: added eval() source-code naming (code is currently disabled)
##################
Version 3.0.0
##################
* added versioning for file format of generated grammar files:
if file is loaded and its file format is out-of-date, an exception will be thrown
NOTE: you should re-generated grammars (use ANT clean & build task)
* added versioning for file format of compiled view / template files:
if file is loaded and its file format is out-of-date, an exception will be thrown
NOTE: you should re-compile views (use ANT default task in mmir-parse.xml)
* added mechanism for enabling RequireJS config settings through config/configuration.json:
if property "config" is set, this will be applied to require.config(..), AFTER the framework
has been initialized and BEFORE the mmir.ready() signal is given
(see documentation of RequireJS for usage of require.config())
NOTE: the requirejs' base-path is currently set to the mmirf/ sub-directory! path references have to start with "../"
in order to navigate to the root directory (where index.html is located).
* added mechanism for configuring MediaManager, ie. which media-plugin implementations should be loaded via
config/configuration.json
(see the MMIR StarterKit demo for an example)
* FIX for MARY-TTS plugin: if TTS is active, incoming requests for TTS are now queued and processed, after the current TTS has finished (before, they were ignored)
##################
Version 3.0beta4
##################
* removed un-documented/private field semanticAnnotationResult from GrammarConverter: now using local variable for handling result of grammar execution
NOTE: you should re-generate the application's grammar files at
/gen/grammar/
(either delete the directory, or use the ANT clean-task; then rebuild
grammars with the ANT build task)
* changed name of default layout: application -> default
NOTE: you have to rename your application's
/views/layout/application.ehtml
to ->
/views/layout/default.ehtml
* added option "usePrecompiledViews" in config/configuration.json for enabling/disabling use of pre-compiled views:
if this option is present and enabled ("true"), pre-compiled views will be used if
(1) the pre-compiled view (*.js) exists for the view (*.ehtml) in gen/views/...
(2) the view (*.ehtml) has not changed, since it has been compiled (verified by using the checksum files)
* Removed "hard-coded" requirejs dependencies for template/view parser from PresentationManager (and view classes):
using "lazy loading" for parsers now (e.g. in case pre-compiled views are used, parsers will not be loaded)
* FIX for stopword removal in SemanticInterpreter: respect word boundaries, ie. do not remove matches that occur within words (e.g. for stopword "in" ignore match within "going")
##################
Version 3.0beta3
##################
* changed to Cordova 3.x
* new project structure for Cordova 3.x
* added function for overwriting default requirejs-config of framework via mmir.config(..)
USAGE NOTE must be invoked, after core.js is loaded AND before requirejs is loaded (in index.html)
##################
Version 3.0beta2
##################
* moved JavaScript files used in build process & testing into separate folder /build/lib/mmir-build/ (and into /test/scripts/ respectively)
* updated build.properties, build.xml and parse.xml accordingly
* updated test.settings, test.xml ect. accordingly
* moved jsonlint library to build directory (only used during build-process and grammar-testing)
* for testSemanticInterpreter.html: copied jsonlint source-code directly into the HTML page
##################
Version 3.0beta / alpha
##################
* change of framework-namespace:
mobileDS -> mmir
e.g. use mmir.DialogEngine (instead of old-style: mobileDS.DialogEngine)
* renamed directory mmirf/res/ -> mmirf/vendor/
* renamed resources:
* renamed files /lanugages/<lang>/speaker.json -> /languages/<lang>/speech.json
* renamed file extension /lanugages/<lang>/dictionary.dic -> /languages/<lang>/dictionary.json
* renamed: elementTypes[.js] -> parserModule[.js]
* moved resources:
* moved checksum files from /config/languages/<lang>/** and /config/statedef/** -> /gen/** (see also comment for build.xml)
* languageManager:
* removed getSpeaker(); replaced by new machanism via getLanguageConfig(str [, str, str])
* NOTE: renamed speaker.json -> speech.json
* NOTE: format for speech.json (previously speaker.json) has changed too!
* renamed (private) function: loadSpeaker() -> loadSpeechConfig()
* renamed function: existsSpeaker() -> existsSpeechConfig()
* constants
* changed speaker.json -> speech.json
* renamed getter function: getSpeakerFileName -> getSpeechConfigFileName
* build.xml
* all checksum files are now located where the generated counterparts are
* unified checksum file names to the file-extension used by the JavaScript checksumUtils code
* removed checksum file generation where these are already created by JavaScript code (i.e. for grammars); ANT tasks uses the JavaScript generated checksums now instead (for up-to-date verification)
* configurationManager
* added support for nested / structured configuration
* changed media-plugin settings into structured settings (for htm5AudioInput and maryTextToSpeech)
* TODO document possible configuration values!!!
* commonUtils:
* renamed: commonUtils.loadAllPhonegapPlugins -> loadAllCordovaPlugins
* notificationManager:
* renamed: Notification -> NotificationManager
* backwards compatibility issues
* mobileDS.constants is now mmir.Constants
(NOTE: case change for first letter!)
* create() is now replaced with init()!
in: Constants, ControllerManager, CommonUtils, MediaManager, ModelManager
* deprecated / removed:
* BROWSER-part of plugins/directoryListing (-> now in CommonUtils!)
* html5Navigator (removed; now use navigator directly...)
* AMD (Asynchronous Module Definition) version for MMIR framework (using requirejs)
* changes in almost all files for modularization (i.e. converting to AMD modules)
* improved separation of framework-code and application-code:
* initialization is now done in /assets/www/mmirf/main.js
* the bootstrap-code for the application is now located in /assets/www/app.js
* adjusted build.xml and parse.xml to new AMD structure
* updated testSemanticInterpreter.html to use new AMD version of the framework
* important changes:
* renamed main namespace: mobileDS -> mmir
* e.g. instead of mobileDS.LanguageManager.getInstance():
-> now use: mmir.LanguageManager.getInstance()
-> or add "backwards compatibility" by creating global variable: var mobileDS = mmir;
* renamed Notification -> NotificationManager (moved file into mmirf/manager/)
* manager modules that had a .create() function: functions renamed to .init() [which return now Promise objects]
##################
Version 2.4.1
##################
(changes are contained within 3.0 notes)
##################
Version 2.4
##################
* implemented pre-compilation for templates (eHTML)
* completed implementation for storing & loading compiled template files
* added pre-compilation code for template-parsing task (in ANT parse.xml)
* added mechanism for loading pre-compiled templates
* configuration for enabling/disabling usage of pre-compiled files
* included up-to-date check (using MD5-checksums) to verify that compiled templates are up-to-date
* grammars:
* added English example grammar (from/used in smart-case example)
* example Japanese dictionary and (minimal) grammar
* test page for semantic-interpreter: FIX in language-selection menu (dropdown box): select currently set language on page-load (before: first entry in the list was selected)
* CommonUtils:
* BUGFIX create instance with new (avoid var-leaking into global namespace)
* updated network-checking code (to reflect/use current Cordova-implementation)
* ControllerManager: refactored info-object creation (for preparing controller-/view-loading)
* BUGFIX load input-manager asynchronously
* BUGFIX prevent default-click behavior in DEFAULT-BUTTON-HANDLER (see vclick handling in executeAfterEachPageIsLoaded())
* cordovaAudioOutput
* removed some commments
* BUGFIX for implementation of isPaused() function
* slightly modified stop() implementation
* removed unnecessary/obsolete callback-id-list mechanism
* FIX: remove onCanPlay listener after first invocation
* FIXED/IMPROVED status-dependent functions (stop() etc);
* NOTE intialization only works error-free in combinaiton with modification in Cordova resources so that on-init event for media/audio is correctly fired in case of async-preparation
* FIX included private field for audio status in order to avoid Exceptions in stop() function
* Cordova (MODIFIACATION for 2.8.1 JAR)
* added listeners in Audio impl. in order to avoid ERROR output (for normal/regular behavior) to LogCat
* BUGFIX in onPreparation() in case of async preparation: only signal MEDIA_STARTING if the current state is lower (e.g. do nothing if already playing)
* FIX for media/audio initialization: in case of async-preparation now INIT-callback is triggered when prepared-listener is invoked (not directly when async-preparation is started as before)
* html5AudioOutput
* remove console debug output
* FIX / WORKAROUND for stop/replay: in case audio does not support timeranges (dependent on server), audio is reloaded, since we cannot reset currentTime to 0
* BUGFIX need this-reference for removing listener in audio-object
* BUGFIX for initialization listener (should only be called once)
* maryTextToSpeech
* BUGFIX trigger onEnd-callback in tts-function if cancel-function is called (i.e. notify ending of TTS)
* FIX set onEnd-callback to null, after calling (avoiding possible, multiple calls to same callback)
* FIX apply encodeURIComponents() to text/sentence before sending to MARY (instead of just encoding space chars)
* webkitAudioInput
* BUGFIX for recognize() implementation
* BUGFIX need to reset variable aborted, otherwise recognition assumes abortion on every listener-callback, if abort/cancel has been invoked once before
* BUGFIX only restart asr if no speech is detected.
* BUGFIX for BUG in case of more than one instance running, ASR would get stuck in an infinite loop
* Notification
* BUGFIX for callback triggering (avoid null-pointer exceptions)
* DISABLED releasing resources on pause (in order to be able to play notification sounds as long as app is only paused and not exited yet)
* added & implemented optional parameter isKeepOnPause for creating notifications sounds (only relevant for ANDROID): if set, sounds are not released when APP pauses
* added initSound() function (for avoiding double-triggering sound upon first playing, e.g. BEEP feedback after starting/resuming APP)
* REFACTORED private method for getting audio-object from internal cache
* removed language-specific functionality from ConfigurationManager (set to @deprecated: instead the LanguageManager should be used directly)
* modified ANT tasks to use integrated SCXML-JS for compiling dialog- and input-engine
* buil-properties/-settings:
* removed properties in build-setting files and ANT script that were required for previous solution (i.e. usage of external SCXML-JS)
* added/extended comments and added example for referencing nodejs in standard MacOS-environment
##################
Version 2.3
##################
* notification: added stopSound() function
* Templating (ehtml): added stringify() function for template representation objects
* Controllers/PresentationManager: added optional callback before_page_load()
* env/media:
* added new Audio Input Module webkitAudioInput.js
* some BUGFIXes for audio output modules (html5 and cordova)
* updated recorder.js/recorderWorker.js
* FIX for hmtl5AudioInput.js in new Chrome version (> 30.x.x): due to performance problems (-> "stutter" in encoded WAV audio) integrated silenceDetection into audio-input module (recorder/recorderWorker)
* added VolumeControl plugin (ANDROID): control Android's volume setting and store/restore volume setting on leaving/entering the APP
* added textarea to login view, and ctrl code for speech input (for TESTING speech input; DISABLED by default)
* (changed default configuration for HTML5-speech-input's WebSocket to default port of new service-implementation)
* added UNICODE support for grammars (UNICODE characters need to be masked within grammar code, since JS/CC cannot handle these!)
- TODO remove obsolete UMLAUTs handling
* improved handling of SEMANTIC object in grammar, in case TOKENS / UTTERANCES are referenced multiple times within a phrase
* BUGFIX handling empty stopword list in grammar definitions (JSON)
* BUGFIX for testSemanticInterpreter.html:
- initialize with controls with correct default-language
- remove languages where no grammar is available, from drop-down list
* improved testSemanticInterpreter.html
- improved layout, added descriptions
- added mask/unmask option for JSON values (-> for non-ASCI unicode chars)
* added check / detailed error message for invalid JSON grammars
- using json-lint
- added check / detail message for build.xml
- added check / detail message for testSemanticInterpreter.html
##################
Version 2.2
##################
* added transitions (animations) for views: now jQuery Mobile page transitions can be used in render(..., {transition: 'jqm transition name', reverse: [true|false]})
- default transition now set in PresentationManager (to: 'none'), instead of in main.js::afterLoadingControllers()
- added example dialogDescriptionSCXML.xml that uses transitions
* BUGFIX for template (.ehtml) parser: avoid false-negative error-messages (i.e. reported errors that are not errors)
* re-factored build.xml: renaming of targets/variables for SemanticInterpreter/Parser (to GrammarParser / -Generator)
* "normalized" Controller interface:
- added getLayout function (and corresponding property)
- added getLayoutName function
- renamed: getViews to getViewNames
- added: getViews [returns a list of the view info/JSON objects]
- renamed: getPartials to getPartialNames
- added: getPartials [returns a list of the partial info/JSON objects]
* added ANT file parser.xml for parsing template files (*.ehtml): layouts, views, partials (as listed in directories.json)
* renamed JavaScript files for ANT build tasks:
- InitForAntRhinoScriptEnv.js -> InitRhinoEnv.js
- AntScriptFileHandler.js -> AntFileHandler.js
- InitForAntNodeJsScriptEnv.js -> InitNodeJsEnv.js
- InitForAntDefaultScriptEnv.js -> InitAntDefaultEnv.js
* updated HTML test page for grammar generation/testing (for new multi-language support of grammars)
* some updates in user-guide.pdf
##################
Version 2.1
##################
* ModelManger:
- API change: now use create(callback) before first usage (instead of getInstance(callback))
- API change: removed getModels() [RETURNS: Array<Object>]; replaced with getModelNames() [RETURNS: Array<String>]
* API change:
- naming convetion for models: now names for model files must be analogous to controller files:
* model class name must correspond to file name (except for first letter: file name may be lower case (or upper case); the class name's first letter MUST be upper case)
* model classes must be specified within namespace mobileDS, e.g. model "CalendarModel": mobileDS.CalendarModel = ...
* multi-language support for speech grammars (incl. automated loading)
* generic loadImpl() function in CommonUtils for loading/executing JavaScript implementation files (with serial / paralell loading modes)
* updated res/xml/config.xml to new Cordova format
* modified event-handling in InputEngine/DialogEngine: changed from touch_end_on_XXX to click_on_XXX
* build.settings / build.properties: moved several propeties into build.properties
* added targets to build.xml
- clean (extended version: now removes all generated files)
- build (compile all necessary files, i.e. compile grammars, update directories.json file etc.)
- doc (generate HTML documentation for framework code; WINDOWS only)
- targets for compiling all available grammar.json files
##################
Version 2.0
##################
----------------------
TODO (changes that may effect application specific code)
----------------------
* build.settings: update your build.settings file (see updated version of build.settingsDefault)
* mobileDS.AudioInput and mobileDS.AudioOutput are now merged into mobileDS.MediaManager
* renamed assets/www/javascripts/ to assets/www/mmirf/ (MMIR Framework)
* renamed parsed_directories.json: directories.json
* moved application specific JS-files into assets/www/appStarterKit/
- suggested file structure: application specific code should be placed into assets/www/app[ application name ]/...
* changed behavior for file-/class-/view-names:
* names will now ALWAYS be treated case-sensitive & corresponding to the file-name, with the exception
* controllers: the controller-class must have the same name as the controller's file
* EXCEPTION if the first character of the file-name is lower-case, the controller-class (and if exists the controller-helper-class) name must be (in difference to the file-name) begin with upper-case
-> controller-class-names must ALWAYS start with an upper-case character (regardless of the controller's file name)
* e.g. for getLayout(controllerName): use getLayout("Application") instead of getLayout("application") even if controller file-name is application.js
(NOTE: the first character of file-names for layouts is treated case-insensitive analog to controller-file-names: regardless of the layout's file-name,
references must always use upper-case for the first character as in the example above)
* partials: partial file-names always start with the character "~"; however, when refering to partials (e.g. @render('Application','languageMenu')) the "~" SHOULD be omitted
* see also comments for PresentationManager
* NOTE: do not forget to update directories.json (default target in build.xml) after adding, removing, or renaming files
* restructured 3rd party JS files, libraries etc.:
- resources (JS-files, CSS-files, images, sounds etc) required by the framework itself are now located in mmirf/vendor/ (previously: mmirf/res/), that is, in the corresponding sub-directories thereof
- application specific JS-files are now located in assets/www/libs/
- other application specific resources are located in assets/www/content/ as before
* InputManager renamed to InputEngine
- initializeDialog: startEngine
- raiseEvent: raise
* changed API: now InputEngine must be created ( mobileDS.InputEngine.create( callback ) ), before it can be used (or its instance be accessed)
* DialogEngine: renamed functions
- show_dialog: showDialog
- close_current_dialog: hideCurrentDialog
- show_wait_dialog: showWaitDialog
- close_wait_dialog: hideWaitDialog
- get_on_page_loaded: getOnPageRenderedHandler
- set_on_page_loaded: setOnPageRenderedHandler
- perform_helper_method: performHelper
- raiseEvent: raise
- initializeDialog: startEngine
* changed API: now DialogEngine must be created ( mobileDS.DialogEngine.create( callback ) ), before it can be used (or its instance be accessed)
* renamed functions in SemanticInterpreter:
- get_asr_semantic: getASRSemantic
- get_asr_semantic_alt: getASRSemantic_alt
- removeStopwordsAlt: removeStopwords_alt
* removed from global namespace
- asr_semantic_annotation
- asr_recognized_text
-> instead use: var asr_recognized_text = mobileDS.SemanticInterpreter.getInstance().getASRSemantic(asr_semantic_annotation);
* "renamed" stem_word: mobileDS.SnowballSimple.stem
* renamed in CommonUtils
- html_comment_regex: regexHTMLComment
- html_resize_font_to_fit_surrounding_box: resizeFitToSourroundingBox
- to_json_string_value: toJSONStringValue
- convert_to_json_value_HTML_string: convertJSONStringValueToHTML
- convert_json_to_HTML_string: convertJSONStringToHTML
- get_params_as_dict: parseParamsToDictionary
* removed deprecated/un-used functions/properties in CommonUtils:
- log
- ehtml2Html
- appendJsSrcToHeader
- partial_name_regex
- partial_parameter_regex
- partial_var_pattern_assignment_regex
- partial_var_pattern_dataobject_regex
- partial_var_pattern_regex
- partial_var_pattern_simpleobject_regex
- render_partial_regex
- value_of_path_regex
- value_of_regex
- get_params_as_dict
- get_date_as_string
- get_duration_as_string
-> NOTE: these can be made re-available by calling setToCompatibilityMode() on the CommonUtils object
* in LanguageManager removed deprecated function:
- translateHTML
- changeLanguage (this was/is an application specific function; a "copy" is available in controller/application.js)
- getCurrentLanguage (same as getLanguage)
* renamed:
- existsGrammarForLanguage: existsGrammar
- existsDictionaryForLanguage: existsDictionary
- existsSpeakerForLanguage: existsSpeaker
- cycleLanguages: setNextLanguage
-> NOTE: these can be made re-available by calling setToCompatibilityMode() on the LanguageManager object
* in ControllerManager renamed:
- performAction: perform
- performHelperAction: performHelper
- initializeControllers: create
* API change:
- removed getControllers() (RETURNS: Array<Controller>); replaced by getControllerNames() (RETURNS: Array<String>)
* in View renamed:
(NOTE these changes are unlikely to effect application specific code)
- performAction: perform
- performActionIfPresent: performIfPresent
* in Helper renamed:
(NOTE these changes are unlikely to effect application specific code)
- performAction: perform
* mobileDS.constants:
- changed for interface:
* needs to initialized using mobileDS.constants.create(env-mode) (NOTE: backwards compatible, i.e. mobileDS.constants.getInstance(new-mode) can be used too)
* afterwards instance can be accessed with mobileDS.constants (i.e. no need for mobileDS.constants.getInstance())
* env-mode can be changed using mobileDS.constants.create(new-mode) or mobileDS.constants.getInstance(new-mode)
* NOTE: this change is backwards-compatible, i.e. can still be used with mobileDS.constants.getInstance(new-mode) as before
* renamed functions:
- getDictionaryFilename: getDictionaryFileName
- getSpeakerFilename: getSpeakerFileName
- getGrammarFilename: getGrammarFileName
* PresentationManager
- removed un-used functions/properties: getVisualComponent, visualComponents
- renamed
- show_dialog: showDialog
- close_current_dialog: hideCurrentDialog
- render_view_successor: doRenderView
- rerenderView: reRenderView
- changed function API (signature):
- addView(view): addView(controllerName, view)
- getView(viewName): getView(controllerName, viewName)
- getPartial(partialName, controller): getPartial(controllerName, partialName)
* renamed functions in GrammarConverter:
(NOTE these changes are unlikely to effect application specific code)
- load_grammar: loadGrammar
- convert_json_grammar: convertJSONGrammar
- set_stop_words: setStopWords
- get_stop_words: getStopWords
- parse_stop_words: parseStopWords
- parse_stop_words_alt: parseStopWords_alt
- get_stop_words_regexp: getStopWordsRegExpr
- get_stop_words_regexp_alt: getStopWordsRegExpr_alt
- get_jscc_grammar: getJSCCGrammar
- get_js_grammar: getJSGrammar
- set_js_grammar: setJSGrammar
- parse_tokes: parseTokens
- parse_utterances: parseUtterances
- parse_utterance: doParseUtterance
- get_semantic_interpretationt_of_utterance: doCreateSemanticInterpretationForUtterance
- get_semantic_interpretationt_of_phrase: doCreateSemanticInterpretationForPhrase
- set_compile_grammar: setGrammarFunction
- compiled_grammar: executeGrammar
- (field) asr_semantic_annotation: semanticAnnotationResult
----------------------
Change Information (changes that mostly concern internal framework code)
----------------------
* index.html:
NOTE: new SCRIPT tag order requirement: "javascripts/gen/grammar.js" must be loaded AFTER "javascripts/semantic/semantic_interpreter.js"
* JSON Grammar files:
- now moved to config/languages/[language code]
- build.xml extended for generating grammar.js-files for JSON-grammar files
+ Compiled Grammar files (named: <language code>_grammar.js) in assets/www/gen/grammar/
* SCION queue implementation moved to .../tools/extensions
* all JS-files .../tools/xxxExtensions moved to sub-directory .../tools/extensions/
* JS-files for building (i.e. used in build.xml) now moved to .../tools/build/
* JS-files for testing (e.g. used in test.xml) now moved to .../tools/test/
* renamed files with underscore naming scheme (now: CamelCase):
- grammar_converter.js: grammarConverter.js
- grammar_parser_template.js: grammarParserTemplate.js
- semantic_interpreter.js: semanticInterpreter.js
- input_manager_engine.js: inputEngine.js
- input_manager_scxml.xml: inputDescriptionSCXML.xml
- input_manager_state_chart.js: InputDescription.js
- dialogDescription.xml: dialogDescriptionSCXML.xml
- DialogEngine.js: dialogEngine.js
##################
Version 1.0
##################
* added support for Partial views
* extended support for template expressions:
- control structures: @if [@else], @for(;;), @for( in )
- partial view expression: @render
- comments: @* *@
- "code execution" expressions: @(), @{ }@
* added message queue for SCION: now raising events from within SCION event-processing code is supported (i.e. from within BIG STEP in SCION)
* added JSDoc generation for framework documentation