sl@0
|
1 |
// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
//
|
sl@0
|
15 |
|
sl@0
|
16 |
#ifndef __SPEECHRECOGNITIONDATADEVASR_H__
|
sl@0
|
17 |
#define __SPEECHRECOGNITIONDATADEVASR_H__
|
sl@0
|
18 |
|
sl@0
|
19 |
// INCLUDES
|
sl@0
|
20 |
#include <mmf/common/speechrecognitiondatacommon.h>
|
sl@0
|
21 |
|
sl@0
|
22 |
|
sl@0
|
23 |
// FORWARD DECLARATION
|
sl@0
|
24 |
class TDiagnostic;
|
sl@0
|
25 |
|
sl@0
|
26 |
|
sl@0
|
27 |
// CLASS DECLARATION
|
sl@0
|
28 |
|
sl@0
|
29 |
/**
|
sl@0
|
30 |
@publishedAll
|
sl@0
|
31 |
@released
|
sl@0
|
32 |
|
sl@0
|
33 |
Class to encapsulate a Speaker Dependent Rule.
|
sl@0
|
34 |
|
sl@0
|
35 |
@since 8.0
|
sl@0
|
36 |
*/
|
sl@0
|
37 |
class CSDRule : public CBase
|
sl@0
|
38 |
{
|
sl@0
|
39 |
public:// Constructors and destructor
|
sl@0
|
40 |
|
sl@0
|
41 |
/**
|
sl@0
|
42 |
Destructor.
|
sl@0
|
43 |
*/
|
sl@0
|
44 |
IMPORT_C ~CSDRule();
|
sl@0
|
45 |
|
sl@0
|
46 |
/**
|
sl@0
|
47 |
Instantiates an instance of CSDRule.
|
sl@0
|
48 |
|
sl@0
|
49 |
@param aRuleID
|
sl@0
|
50 |
The rule identifier.
|
sl@0
|
51 |
@param aLexiconID
|
sl@0
|
52 |
The lexicon identifier.
|
sl@0
|
53 |
@param aPronunciationID
|
sl@0
|
54 |
The pronunciation identifier.
|
sl@0
|
55 |
|
sl@0
|
56 |
@return A pointer to a CSDRule object.
|
sl@0
|
57 |
*/
|
sl@0
|
58 |
IMPORT_C static CSDRule* NewL(TRuleID aRuleID, TLexiconID aLexiconID, TPronunciationID aPronunciationID);
|
sl@0
|
59 |
|
sl@0
|
60 |
/**
|
sl@0
|
61 |
Instantiates an instance of CSDRule and leaves a pointer on the cleanup stack.
|
sl@0
|
62 |
|
sl@0
|
63 |
@param aRuleID
|
sl@0
|
64 |
The rule identifier.
|
sl@0
|
65 |
@param aLexiconID
|
sl@0
|
66 |
The lexicon identifier.
|
sl@0
|
67 |
@param aPronunciationID
|
sl@0
|
68 |
The pronunciation identifier.
|
sl@0
|
69 |
|
sl@0
|
70 |
@return A pointer to a CSDRule object.
|
sl@0
|
71 |
*/
|
sl@0
|
72 |
IMPORT_C static CSDRule* NewLC(TRuleID aRuleID, TLexiconID aLexiconID, TPronunciationID aPronunciationID);
|
sl@0
|
73 |
|
sl@0
|
74 |
|
sl@0
|
75 |
/**
|
sl@0
|
76 |
Returns the rule ID of the result.
|
sl@0
|
77 |
|
sl@0
|
78 |
@return The rule identifier.
|
sl@0
|
79 |
|
sl@0
|
80 |
@since 8.0
|
sl@0
|
81 |
*/
|
sl@0
|
82 |
IMPORT_C TRuleID RuleID() const;
|
sl@0
|
83 |
|
sl@0
|
84 |
/**
|
sl@0
|
85 |
Returns the lexicon ID of the result.
|
sl@0
|
86 |
|
sl@0
|
87 |
@return The lexicon identifier.
|
sl@0
|
88 |
|
sl@0
|
89 |
@since 8.0
|
sl@0
|
90 |
*/
|
sl@0
|
91 |
IMPORT_C TLexiconID LexiconID() const;
|
sl@0
|
92 |
|
sl@0
|
93 |
/**
|
sl@0
|
94 |
Returns the pronunciation ID of the result.
|
sl@0
|
95 |
|
sl@0
|
96 |
@return The pronunciation identifier.
|
sl@0
|
97 |
|
sl@0
|
98 |
@since 8.0
|
sl@0
|
99 |
*/
|
sl@0
|
100 |
IMPORT_C TPronunciationID PronunciationID() const;
|
sl@0
|
101 |
|
sl@0
|
102 |
private:
|
sl@0
|
103 |
void ConstructL();
|
sl@0
|
104 |
CSDRule(TRuleID aRuleID, TLexiconID aLexiconID, TPronunciationID aPronunciationID);
|
sl@0
|
105 |
|
sl@0
|
106 |
private:
|
sl@0
|
107 |
TRuleID iRuleID;
|
sl@0
|
108 |
TLexiconID iLexiconID;
|
sl@0
|
109 |
TPronunciationID iPronunciationID;
|
sl@0
|
110 |
};
|
sl@0
|
111 |
|
sl@0
|
112 |
|
sl@0
|
113 |
/**
|
sl@0
|
114 |
@publishedAll
|
sl@0
|
115 |
@released
|
sl@0
|
116 |
|
sl@0
|
117 |
Class to encapsulate a Speaker Dependent Grammar.
|
sl@0
|
118 |
|
sl@0
|
119 |
A grammar consists of a list of rules.
|
sl@0
|
120 |
|
sl@0
|
121 |
@since 8.0
|
sl@0
|
122 |
*/
|
sl@0
|
123 |
class CSDGrammar : public CBase
|
sl@0
|
124 |
{
|
sl@0
|
125 |
public:// Constructors and destructor
|
sl@0
|
126 |
|
sl@0
|
127 |
/**
|
sl@0
|
128 |
Destructor.
|
sl@0
|
129 |
*/
|
sl@0
|
130 |
IMPORT_C ~CSDGrammar();
|
sl@0
|
131 |
|
sl@0
|
132 |
/**
|
sl@0
|
133 |
Instantiates an instance of CSDGrammar.
|
sl@0
|
134 |
|
sl@0
|
135 |
@param aGrammarID
|
sl@0
|
136 |
The grammar identifier.
|
sl@0
|
137 |
|
sl@0
|
138 |
@return A pointer to a CSDGrammar object.
|
sl@0
|
139 |
*/
|
sl@0
|
140 |
IMPORT_C static CSDGrammar* NewL(TGrammarID aGrammarID);
|
sl@0
|
141 |
|
sl@0
|
142 |
/**
|
sl@0
|
143 |
Instantiates an instance of CSDGrammar and leaves a pointer on the cleanup stack.
|
sl@0
|
144 |
|
sl@0
|
145 |
@param aGrammarID
|
sl@0
|
146 |
The grammar identifier.
|
sl@0
|
147 |
|
sl@0
|
148 |
@return A pointer to CSDGrammar object.
|
sl@0
|
149 |
*/
|
sl@0
|
150 |
IMPORT_C static CSDGrammar* NewLC(TGrammarID aGrammarID);
|
sl@0
|
151 |
|
sl@0
|
152 |
/**
|
sl@0
|
153 |
Returns the grammar ID of the result.
|
sl@0
|
154 |
|
sl@0
|
155 |
@return The grammar identifier.
|
sl@0
|
156 |
|
sl@0
|
157 |
@since 8.0
|
sl@0
|
158 |
*/
|
sl@0
|
159 |
IMPORT_C TGrammarID GrammarID() const;
|
sl@0
|
160 |
|
sl@0
|
161 |
/**
|
sl@0
|
162 |
Adds a rule to the grammar.
|
sl@0
|
163 |
|
sl@0
|
164 |
@param aRule
|
sl@0
|
165 |
A reference to a CSDRule object.
|
sl@0
|
166 |
|
sl@0
|
167 |
@return An error code indicating if the function call was successful. KErrNone on success, otherwise
|
sl@0
|
168 |
another of the system-wide error codes.
|
sl@0
|
169 |
|
sl@0
|
170 |
@since 8.0
|
sl@0
|
171 |
*/
|
sl@0
|
172 |
IMPORT_C TInt Add(CSDRule& aRule);
|
sl@0
|
173 |
|
sl@0
|
174 |
/**
|
sl@0
|
175 |
Deletes a rule from the grammar.
|
sl@0
|
176 |
|
sl@0
|
177 |
@param aRuleID
|
sl@0
|
178 |
The rule identifier to delete.
|
sl@0
|
179 |
|
sl@0
|
180 |
@since 8.0
|
sl@0
|
181 |
*/
|
sl@0
|
182 |
IMPORT_C void Delete(TRuleID aRuleID);
|
sl@0
|
183 |
|
sl@0
|
184 |
/**
|
sl@0
|
185 |
Returns a rule based at an index.
|
sl@0
|
186 |
|
sl@0
|
187 |
@param aIndex
|
sl@0
|
188 |
An index value. The value must not be negative and must not be greater than the number
|
sl@0
|
189 |
of rules currently in the grammar, otherwise the function will panic.
|
sl@0
|
190 |
|
sl@0
|
191 |
@return A reference to a CSDRule object.
|
sl@0
|
192 |
|
sl@0
|
193 |
@since 8.0
|
sl@0
|
194 |
*/
|
sl@0
|
195 |
IMPORT_C const CSDRule& At(TInt aIndex) const;
|
sl@0
|
196 |
|
sl@0
|
197 |
/**
|
sl@0
|
198 |
Finds a rule in the grammar based on the rule ID.
|
sl@0
|
199 |
|
sl@0
|
200 |
@param aRuleID
|
sl@0
|
201 |
The rule identifier.
|
sl@0
|
202 |
|
sl@0
|
203 |
@return The index of the first matching rule within the grammar. Returns KErrNotFound, if a
|
sl@0
|
204 |
matching rule can not be found.
|
sl@0
|
205 |
|
sl@0
|
206 |
@since 8.0
|
sl@0
|
207 |
*/
|
sl@0
|
208 |
IMPORT_C TInt FindRule(TRuleID aRuleID) const;
|
sl@0
|
209 |
|
sl@0
|
210 |
/**
|
sl@0
|
211 |
Returns the number of rules in the grammar
|
sl@0
|
212 |
|
sl@0
|
213 |
@return The number of rules.
|
sl@0
|
214 |
|
sl@0
|
215 |
@since 8.0
|
sl@0
|
216 |
*/
|
sl@0
|
217 |
IMPORT_C TInt Count() const;
|
sl@0
|
218 |
|
sl@0
|
219 |
private:
|
sl@0
|
220 |
void ConstructL();
|
sl@0
|
221 |
CSDGrammar(TGrammarID aGrammarID);
|
sl@0
|
222 |
|
sl@0
|
223 |
private:
|
sl@0
|
224 |
TGrammarID iGrammarID;
|
sl@0
|
225 |
RPointerArray<CSDRule> iRuleArray;
|
sl@0
|
226 |
};
|
sl@0
|
227 |
|
sl@0
|
228 |
|
sl@0
|
229 |
/**
|
sl@0
|
230 |
@publishedAll
|
sl@0
|
231 |
@released
|
sl@0
|
232 |
|
sl@0
|
233 |
Class to encapsulate a Speaker Dependent Pronunciation.
|
sl@0
|
234 |
|
sl@0
|
235 |
@since 8.0
|
sl@0
|
236 |
*/
|
sl@0
|
237 |
class CSDPronunciation : public CBase
|
sl@0
|
238 |
{
|
sl@0
|
239 |
public:// Constructors and destructor
|
sl@0
|
240 |
|
sl@0
|
241 |
/**
|
sl@0
|
242 |
Destructor.
|
sl@0
|
243 |
*/
|
sl@0
|
244 |
IMPORT_C ~CSDPronunciation();
|
sl@0
|
245 |
|
sl@0
|
246 |
/**
|
sl@0
|
247 |
Instantiates an instance of CSDPronunciation.
|
sl@0
|
248 |
|
sl@0
|
249 |
@param aPronunciationID
|
sl@0
|
250 |
The pronunciation identifier.
|
sl@0
|
251 |
@param aModelBankID
|
sl@0
|
252 |
The model bank identifier.
|
sl@0
|
253 |
@param aPhonemeID
|
sl@0
|
254 |
The phoneme identifier.
|
sl@0
|
255 |
|
sl@0
|
256 |
@return A pointer to a CSDPronunciation object.
|
sl@0
|
257 |
*/
|
sl@0
|
258 |
IMPORT_C static CSDPronunciation* NewL(TPronunciationID aPronunciationID, TModelBankID aModelBankID, TPhonemeID aPhonemeID);
|
sl@0
|
259 |
|
sl@0
|
260 |
/**
|
sl@0
|
261 |
Instantiates an instance of CSDPronunciation and leaves a pointer on the cleanup stack.
|
sl@0
|
262 |
|
sl@0
|
263 |
@param aPronunciationID
|
sl@0
|
264 |
The pronunciation identifier.
|
sl@0
|
265 |
@param aModelBankID
|
sl@0
|
266 |
The model bank identifier.
|
sl@0
|
267 |
@param aPhonemeID
|
sl@0
|
268 |
The phoneme identifier.
|
sl@0
|
269 |
|
sl@0
|
270 |
@return A pointer to a CSDPronunciation object.
|
sl@0
|
271 |
*/
|
sl@0
|
272 |
IMPORT_C static CSDPronunciation* NewLC(TPronunciationID aPronunciationID, TModelBankID aModelBankID, TPhonemeID aPhonemeID);
|
sl@0
|
273 |
|
sl@0
|
274 |
/**
|
sl@0
|
275 |
Returns the pronunciation ID of this lexicon entry.
|
sl@0
|
276 |
|
sl@0
|
277 |
@return The pronunciation identifier.
|
sl@0
|
278 |
|
sl@0
|
279 |
@since 8.0
|
sl@0
|
280 |
*/
|
sl@0
|
281 |
IMPORT_C TPronunciationID PronunciationID() const;
|
sl@0
|
282 |
|
sl@0
|
283 |
/**
|
sl@0
|
284 |
Returns the ID of the model bank.
|
sl@0
|
285 |
|
sl@0
|
286 |
@return The model bank identifier.
|
sl@0
|
287 |
|
sl@0
|
288 |
@since 8.0
|
sl@0
|
289 |
*/
|
sl@0
|
290 |
IMPORT_C TModelBankID ModelBankID() const;
|
sl@0
|
291 |
|
sl@0
|
292 |
/**
|
sl@0
|
293 |
Returns the phoneme ID of this lexicon entry.
|
sl@0
|
294 |
|
sl@0
|
295 |
@return The phoneme identifier.
|
sl@0
|
296 |
|
sl@0
|
297 |
@since 8.0
|
sl@0
|
298 |
*/
|
sl@0
|
299 |
IMPORT_C TPhonemeID PhonemeID() const;
|
sl@0
|
300 |
|
sl@0
|
301 |
private:
|
sl@0
|
302 |
void ConstructL();
|
sl@0
|
303 |
CSDPronunciation(TPronunciationID aPronunciationID, TModelBankID aModelBankID, TPhonemeID aPhonemeID);
|
sl@0
|
304 |
|
sl@0
|
305 |
private:
|
sl@0
|
306 |
TPronunciationID iPronunciationID;
|
sl@0
|
307 |
TModelBankID iModelBankID;
|
sl@0
|
308 |
TPhonemeID iPhonemeID;
|
sl@0
|
309 |
};
|
sl@0
|
310 |
|
sl@0
|
311 |
|
sl@0
|
312 |
/**
|
sl@0
|
313 |
@publishedAll
|
sl@0
|
314 |
@released
|
sl@0
|
315 |
|
sl@0
|
316 |
Class to encapsulate a Speaker Dependent Lexicon.
|
sl@0
|
317 |
|
sl@0
|
318 |
@since 8.0
|
sl@0
|
319 |
*/
|
sl@0
|
320 |
class CSDLexicon : public CBase
|
sl@0
|
321 |
{
|
sl@0
|
322 |
public:// Constructors and destructor
|
sl@0
|
323 |
|
sl@0
|
324 |
/**
|
sl@0
|
325 |
Destructor.
|
sl@0
|
326 |
*/
|
sl@0
|
327 |
IMPORT_C ~CSDLexicon();
|
sl@0
|
328 |
|
sl@0
|
329 |
/**
|
sl@0
|
330 |
Instantiates an instance of CSDLexicon.
|
sl@0
|
331 |
|
sl@0
|
332 |
@param aLexiconID
|
sl@0
|
333 |
The lexicon identifier.
|
sl@0
|
334 |
|
sl@0
|
335 |
@return A pointer to a CSDLexicon object.
|
sl@0
|
336 |
*/
|
sl@0
|
337 |
IMPORT_C static CSDLexicon* NewL(TLexiconID aLexiconID);
|
sl@0
|
338 |
|
sl@0
|
339 |
/**
|
sl@0
|
340 |
Instantiates an instance of CSDGrammar and leaves a pointer on the cleanup stack.
|
sl@0
|
341 |
|
sl@0
|
342 |
@param aLexiconID
|
sl@0
|
343 |
The lexicon identifier.
|
sl@0
|
344 |
|
sl@0
|
345 |
@return A pointer to a CSDLexicon object.
|
sl@0
|
346 |
*/
|
sl@0
|
347 |
IMPORT_C static CSDLexicon* NewLC(TLexiconID aLexiconID);
|
sl@0
|
348 |
|
sl@0
|
349 |
/**
|
sl@0
|
350 |
Returns the ID of the lexicon.
|
sl@0
|
351 |
|
sl@0
|
352 |
@return The lexicon identifier.
|
sl@0
|
353 |
|
sl@0
|
354 |
@since 8.0
|
sl@0
|
355 |
*/
|
sl@0
|
356 |
IMPORT_C TLexiconID LexiconID() const;
|
sl@0
|
357 |
|
sl@0
|
358 |
/**
|
sl@0
|
359 |
Adds a lexicon entry to the lexicon.
|
sl@0
|
360 |
|
sl@0
|
361 |
@param aPronunciation
|
sl@0
|
362 |
A reference to a CSDPronunciation object.
|
sl@0
|
363 |
|
sl@0
|
364 |
@return An error code indicating if the function call was successful. KErrNone on success, otherwise
|
sl@0
|
365 |
another of the system-wide error codes.
|
sl@0
|
366 |
|
sl@0
|
367 |
@since 8.0
|
sl@0
|
368 |
*/
|
sl@0
|
369 |
IMPORT_C TInt Add(CSDPronunciation& aPronunciation);
|
sl@0
|
370 |
|
sl@0
|
371 |
/**
|
sl@0
|
372 |
Returns a pronunciation based at an index.
|
sl@0
|
373 |
|
sl@0
|
374 |
@param aIndex
|
sl@0
|
375 |
The pronunciation index. This value must not be negative and must not be greater than
|
sl@0
|
376 |
the number of pronunciations currently in the lexicon, otherwise the function will
|
sl@0
|
377 |
panic.
|
sl@0
|
378 |
|
sl@0
|
379 |
@return A reference to a CSDPronunciation object.
|
sl@0
|
380 |
|
sl@0
|
381 |
@since 8.0
|
sl@0
|
382 |
*/
|
sl@0
|
383 |
IMPORT_C const CSDPronunciation& At(TInt aIndex) const;
|
sl@0
|
384 |
|
sl@0
|
385 |
/**
|
sl@0
|
386 |
Finds a pronunciation based on the specified pronunciation ID.
|
sl@0
|
387 |
|
sl@0
|
388 |
@param aPronunciationID
|
sl@0
|
389 |
The pronunciation identifier.
|
sl@0
|
390 |
|
sl@0
|
391 |
@return The index of the first matching pronunciation within the lexicon. Returns KErrNotFound,
|
sl@0
|
392 |
if a matching pronunciation can not be found.
|
sl@0
|
393 |
*/
|
sl@0
|
394 |
IMPORT_C TInt FindPronunciation(TPronunciationID aPronunciationID) const;
|
sl@0
|
395 |
|
sl@0
|
396 |
/**
|
sl@0
|
397 |
Returns the number of lexicon entries in the lexicon.
|
sl@0
|
398 |
|
sl@0
|
399 |
@return The number of pronunciations.
|
sl@0
|
400 |
|
sl@0
|
401 |
@since 8.0
|
sl@0
|
402 |
*/
|
sl@0
|
403 |
IMPORT_C TInt Count() const;
|
sl@0
|
404 |
|
sl@0
|
405 |
private:
|
sl@0
|
406 |
void ConstructL();
|
sl@0
|
407 |
CSDLexicon(TLexiconID aLexiconID);
|
sl@0
|
408 |
|
sl@0
|
409 |
private:
|
sl@0
|
410 |
TLexiconID iLexiconID;
|
sl@0
|
411 |
RPointerArray<CSDPronunciation> iPronunciationArray;
|
sl@0
|
412 |
};
|
sl@0
|
413 |
|
sl@0
|
414 |
|
sl@0
|
415 |
/**
|
sl@0
|
416 |
@publishedAll
|
sl@0
|
417 |
@released
|
sl@0
|
418 |
|
sl@0
|
419 |
Class to encapsulate a Speaker Dependent Model created during the training process.
|
sl@0
|
420 |
|
sl@0
|
421 |
@since 8.0
|
sl@0
|
422 |
*/
|
sl@0
|
423 |
class CSDModel : public CBase
|
sl@0
|
424 |
{
|
sl@0
|
425 |
public:// Constructors and destructor
|
sl@0
|
426 |
|
sl@0
|
427 |
/**
|
sl@0
|
428 |
Destructor.
|
sl@0
|
429 |
*/
|
sl@0
|
430 |
IMPORT_C ~CSDModel();
|
sl@0
|
431 |
|
sl@0
|
432 |
/**
|
sl@0
|
433 |
Instantiates an instance of a CSDModel.
|
sl@0
|
434 |
|
sl@0
|
435 |
@return A pointer to a CSDModel object.
|
sl@0
|
436 |
*/
|
sl@0
|
437 |
IMPORT_C static CSDModel* NewL();
|
sl@0
|
438 |
|
sl@0
|
439 |
/**
|
sl@0
|
440 |
Instantiates an instance of a CSDModel.
|
sl@0
|
441 |
|
sl@0
|
442 |
@return A pointer to a CSDModel object.
|
sl@0
|
443 |
*/
|
sl@0
|
444 |
IMPORT_C static CSDModel* NewLC();
|
sl@0
|
445 |
|
sl@0
|
446 |
/**
|
sl@0
|
447 |
Instantiates an instance of a CSDModel.
|
sl@0
|
448 |
|
sl@0
|
449 |
@param aPhonemeID
|
sl@0
|
450 |
The phoneme identifier.
|
sl@0
|
451 |
|
sl@0
|
452 |
@return A pointer to a CSDModel object.
|
sl@0
|
453 |
*/
|
sl@0
|
454 |
IMPORT_C static CSDModel* NewL(TPhonemeID aPhonemeID);
|
sl@0
|
455 |
|
sl@0
|
456 |
/**
|
sl@0
|
457 |
Instantiates an instance of a CSDModel.
|
sl@0
|
458 |
|
sl@0
|
459 |
@param aPhonemeID
|
sl@0
|
460 |
The phoneme identifier.
|
sl@0
|
461 |
|
sl@0
|
462 |
@return A pointer to a CSDModel object.
|
sl@0
|
463 |
*/
|
sl@0
|
464 |
IMPORT_C static CSDModel* NewLC(TPhonemeID aPhonemeID);
|
sl@0
|
465 |
|
sl@0
|
466 |
/**
|
sl@0
|
467 |
Sets the phoneme ID of this model.
|
sl@0
|
468 |
|
sl@0
|
469 |
@param aPhonemeID
|
sl@0
|
470 |
The phoneme identifier.
|
sl@0
|
471 |
|
sl@0
|
472 |
@since 8.0
|
sl@0
|
473 |
*/
|
sl@0
|
474 |
IMPORT_C void SetPhonemeID(TPhonemeID aPhonemeID);
|
sl@0
|
475 |
|
sl@0
|
476 |
/**
|
sl@0
|
477 |
Returns the phoneme ID of this model.
|
sl@0
|
478 |
|
sl@0
|
479 |
@return The phoneme identifier.
|
sl@0
|
480 |
|
sl@0
|
481 |
@since 8.0
|
sl@0
|
482 |
*/
|
sl@0
|
483 |
IMPORT_C TPhonemeID PhonemeID() const;
|
sl@0
|
484 |
|
sl@0
|
485 |
/**
|
sl@0
|
486 |
Sets the acoustic model of the model.
|
sl@0
|
487 |
|
sl@0
|
488 |
@param aAcousticModel
|
sl@0
|
489 |
A pointer descriptor containing the acoustic model (binary).
|
sl@0
|
490 |
|
sl@0
|
491 |
@since 8.0
|
sl@0
|
492 |
*/
|
sl@0
|
493 |
IMPORT_C void SetAcousticModel(TPtr8& aAcousticModel);
|
sl@0
|
494 |
|
sl@0
|
495 |
/**
|
sl@0
|
496 |
Gets a pointer to the acoustic model of this model.
|
sl@0
|
497 |
|
sl@0
|
498 |
@return A descriptor to the acoustic model data.
|
sl@0
|
499 |
|
sl@0
|
500 |
@since 8.0
|
sl@0
|
501 |
*/
|
sl@0
|
502 |
IMPORT_C const TDesC8& AcousticModel() const;
|
sl@0
|
503 |
|
sl@0
|
504 |
private:
|
sl@0
|
505 |
void ConstructL();
|
sl@0
|
506 |
CSDModel();
|
sl@0
|
507 |
CSDModel(TPhonemeID aPhonemeID);
|
sl@0
|
508 |
|
sl@0
|
509 |
private:
|
sl@0
|
510 |
TPhonemeID iPhonemeID;
|
sl@0
|
511 |
TPtr8 iAcousticModelPtr;
|
sl@0
|
512 |
};
|
sl@0
|
513 |
|
sl@0
|
514 |
|
sl@0
|
515 |
/**
|
sl@0
|
516 |
@publishedAll
|
sl@0
|
517 |
@released
|
sl@0
|
518 |
|
sl@0
|
519 |
Class to encapsulate a Speaker Dependent Model Bank used by the recognizer during the
|
sl@0
|
520 |
recognition process.
|
sl@0
|
521 |
|
sl@0
|
522 |
@since 8.0
|
sl@0
|
523 |
*/
|
sl@0
|
524 |
class CSDModelBank : public CBase
|
sl@0
|
525 |
{
|
sl@0
|
526 |
public:// Constructors and destructor
|
sl@0
|
527 |
|
sl@0
|
528 |
/**
|
sl@0
|
529 |
Destructor.
|
sl@0
|
530 |
*/
|
sl@0
|
531 |
IMPORT_C ~CSDModelBank();
|
sl@0
|
532 |
|
sl@0
|
533 |
/**
|
sl@0
|
534 |
Instantiates an instance of a CSDModelBank.
|
sl@0
|
535 |
|
sl@0
|
536 |
@param aModelBankID
|
sl@0
|
537 |
The model bank identifier.
|
sl@0
|
538 |
|
sl@0
|
539 |
@return A pointer to a CSDModelBank object.
|
sl@0
|
540 |
*/
|
sl@0
|
541 |
IMPORT_C static CSDModelBank* NewL(TModelBankID aModelBankID);
|
sl@0
|
542 |
|
sl@0
|
543 |
/**
|
sl@0
|
544 |
Instantiates an instance of a CSDModelBank and leaves a pointer on the cleanup stack.
|
sl@0
|
545 |
|
sl@0
|
546 |
@param aModelBankID
|
sl@0
|
547 |
The model bank identifier.
|
sl@0
|
548 |
|
sl@0
|
549 |
@return A pointer to a CSDModelBank object.
|
sl@0
|
550 |
*/
|
sl@0
|
551 |
IMPORT_C static CSDModelBank* NewLC(TModelBankID aModelBankID);
|
sl@0
|
552 |
|
sl@0
|
553 |
/**
|
sl@0
|
554 |
Returns the model bank ID of the model bank.
|
sl@0
|
555 |
|
sl@0
|
556 |
@return The model bank identifier.
|
sl@0
|
557 |
|
sl@0
|
558 |
@since 8.0
|
sl@0
|
559 |
*/
|
sl@0
|
560 |
IMPORT_C TModelBankID ModelBankID() const;
|
sl@0
|
561 |
|
sl@0
|
562 |
/**
|
sl@0
|
563 |
Adds a model to the model bank.
|
sl@0
|
564 |
|
sl@0
|
565 |
@param aModel
|
sl@0
|
566 |
The reference to CSDModel object.
|
sl@0
|
567 |
|
sl@0
|
568 |
@return An error code indicating if the function call was successful. KErrNone on success, otherwise
|
sl@0
|
569 |
another of the system-wide error codes.
|
sl@0
|
570 |
|
sl@0
|
571 |
@since 8.0
|
sl@0
|
572 |
*/
|
sl@0
|
573 |
IMPORT_C TInt Add(CSDModel& aModel);
|
sl@0
|
574 |
|
sl@0
|
575 |
/**
|
sl@0
|
576 |
Returns a model at the given index.
|
sl@0
|
577 |
|
sl@0
|
578 |
@param aIndex
|
sl@0
|
579 |
A reference to a CSDModel object.
|
sl@0
|
580 |
|
sl@0
|
581 |
@return The index of the first matching model within the model bank. Returns KErrNotFound, if a
|
sl@0
|
582 |
matching model can not be found.
|
sl@0
|
583 |
|
sl@0
|
584 |
@since 8.0
|
sl@0
|
585 |
*/
|
sl@0
|
586 |
IMPORT_C const CSDModel& At(TInt aIndex) const;
|
sl@0
|
587 |
|
sl@0
|
588 |
/**
|
sl@0
|
589 |
Finds a model based on the specified phoneme ID.
|
sl@0
|
590 |
|
sl@0
|
591 |
@param aPhonemeID
|
sl@0
|
592 |
The phoneme ID.
|
sl@0
|
593 |
|
sl@0
|
594 |
@return The index of the first matching model within the model bank. Returns KErrNotFound, if a
|
sl@0
|
595 |
matching model can not be found.
|
sl@0
|
596 |
|
sl@0
|
597 |
@since 8.0
|
sl@0
|
598 |
*/
|
sl@0
|
599 |
IMPORT_C TInt FindModel(TPhonemeID aPhonemeID) const;
|
sl@0
|
600 |
|
sl@0
|
601 |
/**
|
sl@0
|
602 |
Returns the number of models in the model bank.
|
sl@0
|
603 |
|
sl@0
|
604 |
@return The number of models in the model bank.
|
sl@0
|
605 |
|
sl@0
|
606 |
@since 8.0
|
sl@0
|
607 |
*/
|
sl@0
|
608 |
IMPORT_C TInt Count() const;
|
sl@0
|
609 |
|
sl@0
|
610 |
private:
|
sl@0
|
611 |
void ConstructL();
|
sl@0
|
612 |
CSDModelBank(TModelBankID aModelBankID);
|
sl@0
|
613 |
|
sl@0
|
614 |
private:
|
sl@0
|
615 |
TModelBankID iModelBankID;
|
sl@0
|
616 |
RPointerArray<CSDModel> iModelArray;
|
sl@0
|
617 |
};
|
sl@0
|
618 |
|
sl@0
|
619 |
|
sl@0
|
620 |
/**
|
sl@0
|
621 |
@publishedAll
|
sl@0
|
622 |
@released
|
sl@0
|
623 |
|
sl@0
|
624 |
Class to encapsulate a Recognition Result
|
sl@0
|
625 |
|
sl@0
|
626 |
@since 8.0
|
sl@0
|
627 |
*/
|
sl@0
|
628 |
class CSDResult : public CBase
|
sl@0
|
629 |
{
|
sl@0
|
630 |
public:// Constructors and destructor
|
sl@0
|
631 |
|
sl@0
|
632 |
/**
|
sl@0
|
633 |
Destructor.
|
sl@0
|
634 |
*/
|
sl@0
|
635 |
IMPORT_C ~CSDResult();
|
sl@0
|
636 |
|
sl@0
|
637 |
/**
|
sl@0
|
638 |
Instantiates an instance of a CSDResult.
|
sl@0
|
639 |
|
sl@0
|
640 |
@return A pointer to a CSDResult object.
|
sl@0
|
641 |
*/
|
sl@0
|
642 |
IMPORT_C static CSDResult* NewL();
|
sl@0
|
643 |
|
sl@0
|
644 |
/**
|
sl@0
|
645 |
Instantiates an instance of CSDResult and leaves a pointer on the cleanup stack.
|
sl@0
|
646 |
|
sl@0
|
647 |
@return A pointer to a CSDResult object.
|
sl@0
|
648 |
*/
|
sl@0
|
649 |
IMPORT_C static CSDResult* NewLC();
|
sl@0
|
650 |
|
sl@0
|
651 |
/**
|
sl@0
|
652 |
Instantiates an instance of a CSDResult.
|
sl@0
|
653 |
|
sl@0
|
654 |
@param aGrammarID
|
sl@0
|
655 |
The grammar identifier.
|
sl@0
|
656 |
@param aRuleID
|
sl@0
|
657 |
The rule identifier.
|
sl@0
|
658 |
|
sl@0
|
659 |
@return A pointer to a CSDResult object.
|
sl@0
|
660 |
*/
|
sl@0
|
661 |
IMPORT_C static CSDResult* NewL(TGrammarID aGrammarID, TRuleID aRuleID);
|
sl@0
|
662 |
|
sl@0
|
663 |
/**
|
sl@0
|
664 |
Instantiates an instance of a CSDResult and leaves a pointer on the cleanup stack.
|
sl@0
|
665 |
|
sl@0
|
666 |
@param aGrammarID
|
sl@0
|
667 |
The grammar identifier.
|
sl@0
|
668 |
@param aRuleID
|
sl@0
|
669 |
The rule identifier.
|
sl@0
|
670 |
|
sl@0
|
671 |
@return A pointer to a CSDResult object.
|
sl@0
|
672 |
*/
|
sl@0
|
673 |
IMPORT_C static CSDResult* NewLC(TGrammarID aGrammarID, TRuleID aRuleID);
|
sl@0
|
674 |
|
sl@0
|
675 |
/**
|
sl@0
|
676 |
Sets the grammar ID on the result.
|
sl@0
|
677 |
|
sl@0
|
678 |
@param aGrammarID
|
sl@0
|
679 |
The grammar identifier.
|
sl@0
|
680 |
|
sl@0
|
681 |
@since 8.0
|
sl@0
|
682 |
*/
|
sl@0
|
683 |
IMPORT_C void SetGrammarID(TGrammarID aGrammarID);
|
sl@0
|
684 |
|
sl@0
|
685 |
/**
|
sl@0
|
686 |
Returns the grammar ID of the result.
|
sl@0
|
687 |
|
sl@0
|
688 |
@return The grammar identifier.
|
sl@0
|
689 |
|
sl@0
|
690 |
@since 8.0
|
sl@0
|
691 |
*/
|
sl@0
|
692 |
IMPORT_C TGrammarID GrammarID() const;
|
sl@0
|
693 |
|
sl@0
|
694 |
/**
|
sl@0
|
695 |
Sets the rule ID of the result.
|
sl@0
|
696 |
|
sl@0
|
697 |
@param aRuleID
|
sl@0
|
698 |
The rule identifier.
|
sl@0
|
699 |
|
sl@0
|
700 |
@since 8.0
|
sl@0
|
701 |
*/
|
sl@0
|
702 |
IMPORT_C void SetRuleID(TRuleID aRuleID);
|
sl@0
|
703 |
|
sl@0
|
704 |
/**
|
sl@0
|
705 |
Returns the rule ID of the result.
|
sl@0
|
706 |
|
sl@0
|
707 |
@return The rule identifier.
|
sl@0
|
708 |
|
sl@0
|
709 |
@since 8.0
|
sl@0
|
710 |
*/
|
sl@0
|
711 |
IMPORT_C TRuleID RuleID() const;
|
sl@0
|
712 |
|
sl@0
|
713 |
/**
|
sl@0
|
714 |
Sets the score for this result.
|
sl@0
|
715 |
|
sl@0
|
716 |
@param aScore
|
sl@0
|
717 |
The score of this result.
|
sl@0
|
718 |
|
sl@0
|
719 |
@since 8.0
|
sl@0
|
720 |
*/
|
sl@0
|
721 |
IMPORT_C void SetScore(const TInt32 aScore);
|
sl@0
|
722 |
|
sl@0
|
723 |
/**
|
sl@0
|
724 |
Returns the score of this result.
|
sl@0
|
725 |
|
sl@0
|
726 |
@return The score of this result.
|
sl@0
|
727 |
|
sl@0
|
728 |
@since 8.0
|
sl@0
|
729 |
*/
|
sl@0
|
730 |
IMPORT_C TInt32 Score() const;
|
sl@0
|
731 |
|
sl@0
|
732 |
private:
|
sl@0
|
733 |
void ConstructL();
|
sl@0
|
734 |
CSDResult();
|
sl@0
|
735 |
CSDResult(TGrammarID aGrammarID, TRuleID aRuleID);
|
sl@0
|
736 |
|
sl@0
|
737 |
private:
|
sl@0
|
738 |
TGrammarID iGrammarID;
|
sl@0
|
739 |
TRuleID iRuleID;
|
sl@0
|
740 |
TInt32 iScore;
|
sl@0
|
741 |
};
|
sl@0
|
742 |
|
sl@0
|
743 |
|
sl@0
|
744 |
/**
|
sl@0
|
745 |
@publishedAll
|
sl@0
|
746 |
@released
|
sl@0
|
747 |
|
sl@0
|
748 |
CSDResultSet encapsulates a set of result objects returned by the recognizer at the end of the
|
sl@0
|
749 |
recognition process. A result set may include additional diagnostic information for error analysis.
|
sl@0
|
750 |
|
sl@0
|
751 |
@since 8.0
|
sl@0
|
752 |
*/
|
sl@0
|
753 |
class CSDResultSet : public CBase
|
sl@0
|
754 |
{
|
sl@0
|
755 |
public:// Constructors and destructor
|
sl@0
|
756 |
|
sl@0
|
757 |
/**
|
sl@0
|
758 |
Destructor.
|
sl@0
|
759 |
*/
|
sl@0
|
760 |
IMPORT_C ~CSDResultSet();
|
sl@0
|
761 |
|
sl@0
|
762 |
/**
|
sl@0
|
763 |
Instantiates an instance of CSDResultSet.
|
sl@0
|
764 |
|
sl@0
|
765 |
@return A pointer to a CSDResultSet object.
|
sl@0
|
766 |
*/
|
sl@0
|
767 |
IMPORT_C static CSDResultSet* NewL();
|
sl@0
|
768 |
|
sl@0
|
769 |
/**
|
sl@0
|
770 |
Instantiates an instance of CSDResultSet and leaves a pointer on the cleanup stack.
|
sl@0
|
771 |
|
sl@0
|
772 |
@return A pointer to a CSDResultSet object.
|
sl@0
|
773 |
*/
|
sl@0
|
774 |
IMPORT_C static CSDResultSet* NewLC();
|
sl@0
|
775 |
|
sl@0
|
776 |
/**
|
sl@0
|
777 |
Adds a result to the rule set.
|
sl@0
|
778 |
|
sl@0
|
779 |
@param aResult
|
sl@0
|
780 |
A reference to the result object to be added.
|
sl@0
|
781 |
|
sl@0
|
782 |
@return An error code indicating if the function call was successful. KErrNone on success, otherwise
|
sl@0
|
783 |
another of the system-wide error codes.
|
sl@0
|
784 |
|
sl@0
|
785 |
@since 8.0
|
sl@0
|
786 |
*/
|
sl@0
|
787 |
IMPORT_C TInt Add(CSDResult& aResult);
|
sl@0
|
788 |
|
sl@0
|
789 |
/**
|
sl@0
|
790 |
Returns a result at a given index within the result set.
|
sl@0
|
791 |
|
sl@0
|
792 |
@param aIndex
|
sl@0
|
793 |
The index in the result set.
|
sl@0
|
794 |
|
sl@0
|
795 |
@return A reference to CSDResult object.
|
sl@0
|
796 |
|
sl@0
|
797 |
@since 8.0
|
sl@0
|
798 |
*/
|
sl@0
|
799 |
IMPORT_C const CSDResult& At(TInt aIndex);
|
sl@0
|
800 |
|
sl@0
|
801 |
/**
|
sl@0
|
802 |
Returns the number of results in the result set.
|
sl@0
|
803 |
|
sl@0
|
804 |
@return The number of results in the result set.
|
sl@0
|
805 |
|
sl@0
|
806 |
@since 8.0
|
sl@0
|
807 |
*/
|
sl@0
|
808 |
IMPORT_C TInt Count() const;
|
sl@0
|
809 |
|
sl@0
|
810 |
/**
|
sl@0
|
811 |
Sets the diagnostic of this result set.
|
sl@0
|
812 |
|
sl@0
|
813 |
@param aDiagnostic
|
sl@0
|
814 |
A reference to the diagostic object.
|
sl@0
|
815 |
|
sl@0
|
816 |
@since 8.0
|
sl@0
|
817 |
*/
|
sl@0
|
818 |
IMPORT_C void SetDiagnostic(TDiagnostic& aDiagnostic);
|
sl@0
|
819 |
|
sl@0
|
820 |
/**
|
sl@0
|
821 |
Gets the diagnostic of this result set.
|
sl@0
|
822 |
|
sl@0
|
823 |
@return A reference to A TDiagnostic object.
|
sl@0
|
824 |
|
sl@0
|
825 |
@since 8.0
|
sl@0
|
826 |
*/
|
sl@0
|
827 |
IMPORT_C const TDiagnostic& Diagnostic() const;
|
sl@0
|
828 |
|
sl@0
|
829 |
private:
|
sl@0
|
830 |
void ConstructL();
|
sl@0
|
831 |
CSDResultSet();
|
sl@0
|
832 |
|
sl@0
|
833 |
private:
|
sl@0
|
834 |
RPointerArray<CSDResult> iResultArray;
|
sl@0
|
835 |
TDiagnostic* iDiagnostic;
|
sl@0
|
836 |
};
|
sl@0
|
837 |
|
sl@0
|
838 |
|
sl@0
|
839 |
#endif
|