!7 srecord Replacement(S in, S out) { // in = heard phrase, out = said phrase } cmodule ELEApplyRecognitionReplacements > DynPrintLogAndEnabled { start { dm_onUserUtteranceWithoutMine(ivf1 processInput); } void processInput(S input) { L l = getReplacements(); FullPhraseCache phraseCache = makeFullPhraseCache(map(l, r -> r.in)); LS tok = javaTokNPunct(input); L ranges = fullPhraseCache_tokenRanges(phraseCache, tok); if (empty(ranges)) ret; print("Found replaceable phrases: " + getJoinedTokenRangesWithoutN(tok, ranges)); } L getReplacements() { L l = dm_getConcepts(dm_require("#1026379/ELERecognitionReplacements")); ret shallowCloneListToClass Replacement(l); } }