Re: [simon-development] Acoustic Model Switching
Brought to you by:
speechtotext
|
From: Peter G. <gr...@si...> - 2011-12-14 17:43:14
|
Hi Adam, On Tuesday 13 December 2011 19:02:01 Adam Nash wrote: > Ok, I'm done with jury duty now. I found the state of new york guilty > of wasting my time :D :) > I made the existing sample groups available in a combobox in the > samplegroupcontext table view. Ok, cool. > > Also, make sure that the Cancel button works -> don't work on the real > > configuration but a copy! > > I will get to this next. Maybe I can make it make direct changes (I > can't copy ContextManager without angering the gods of the singleton > pattern beyond reason), but when ok or apply is clicked it saves them? > And if cancel is clicked it will just load its saved configuration. > That sounds easy to me, but is it too easy to be a good idea? Hm. That sounds like a bit of a hack to me. I can think of two - imho cleaner - solutions for this: * Make the actual configuration a separate, copyable object that is held and managed by the ContextManager singleton. That way you can copy it and apply / reset becomes straight forward. * Or: If copying the configuration would be expensive (which it likely is, considering that there are possibly a lot of plugins involved), you can just keep track of a list of "scheduled changes" and apply / reset that list on save() / cancel(). (hint: Command pattern) > Speaking of ContextManager - I noticed that its instance never gets > deleted and its destructor is never called because the destructor in > SimonControl is never called. This also means that none of the > conditions are deleted. This is probably bad I think? :P > I am not on good terms with the singleton gods, so I will be happy to > take advice on how to deal with this. If you find out, tell me about it :) No, seriously that's something that's already causing problems in other parts of simon. Frederik suggested to look into K_GLOBAL_STATIC and it seems to provide a means to fix that problem: http://api.kde.org/4.x-api/kdelibs- apidocs/kdecore/html/group__KDEMacros.html#ga75ca0c60b03dc5e4f9427263bf4043c7 I haven't yet looked into it properly, though. > > Btw.: There seems to be a very annoying bug somewhere in the caching > > system. If you start with a fresh installation, simon will complain > > about not finding something in the cache. Could you please have a look? > > I will look at this. I thought that if there was no cache it just sets > a new one up (I was pretty routinely deleting my entire cache when > working with the context adapter). Also, I don't think I made anything > that pops up error messages, just kDebug output. Will there be a > difference between a new installation and an old one with just the > context cache deleted? There shouldn't be, I guess. I just dug up the concrete error message: Could not adapt prompts. Does the file "c:/users/<foo>/appdata/roaming/.kde/share/apps/simond/models/default/cached//acoustic models/default/prompts" exist? It looks like simond tries to access a cached prompts file that doesn't exist. That happened when using a static model (no training data). Does that help? Best regards, Peter |