Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Speech / Src / Result / RecognizedWordUnit.cs / 1 / RecognizedWordUnit.cs
//------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------- using System; using System.Diagnostics; using System.Speech.Internal; #pragma warning disable 1634, 1691 // Allows suppression of certain PreSharp messages. namespace System.Speech.Recognition { /// TODOC <_include file='doc\RecognitionResult.uex' path='docs/doc[@for="RecognizedWordUnit"]/*' /> [Serializable] [DebuggerDisplay ("Text: {Text}")] public class RecognizedWordUnit { //******************************************************************* // // Constructors // //******************************************************************* #region Constructors #pragma warning disable 6504 #pragma warning disable 6507 // Constructor for recognized 'word' /// TODOC <_include file='doc\RecognitionResult.uex' path='docs/doc[@for="RecognizedWordUnit.ctor"]/*' /> public RecognizedWordUnit (string text, float confidence, string pronunciation, string lexicalForm, DisplayAttributes displayAttributes, TimeSpan audioPosition, TimeSpan audioDuration) { if (lexicalForm == null) { throw new ArgumentNullException ("lexicalForm"); } if (confidence < 0.0f || confidence > 1.0f) { throw new ArgumentOutOfRangeException (SR.Get (SRID.InvalidConfidence)); } _text = text == null || text.Length == 0 ? null : text; _confidence = confidence; _pronunciation = pronunciation == null || pronunciation.Length == 0 ? null : pronunciation; _lexicalForm = lexicalForm; _displayAttributes = displayAttributes; _audioPosition = audioPosition; _audioDuration = audioDuration; } #pragma warning restore 6504 #pragma warning restore 6507 #endregion //******************************************************************** // // Public Properties // //******************************************************************* #region Public Properties // Spoken text of the word {No conversion to display form} /// TODOC <_include file='doc\RecognitionResult.uex' path='docs/doc[@for="RecognizedWordUnit.Text"]/*' /> public string Text { get { return _text; } } // Confidence score /// TODOC <_include file='doc\RecognitionResult.uex' path='docs/doc[@for="RecognizedWordUnit.Confidence"]/*' /> public float Confidence { get { return _confidence; } } /// TODOC <_include file='doc\RecognitionResult.uex' path='docs/doc[@for="RecognizedWordUnit.PronunciationString"]/*' /> public string Pronunciation { get { return _pronunciation; } } ////// TODOC /// public string LexicalForm { get { return _lexicalForm; } } ////// TODOC /// public DisplayAttributes DisplayAttributes { get { return _displayAttributes; } } #endregion //******************************************************************** // // Internal Methods // //******************************************************************** #region Internal Methods internal static byte DisplayAttributesToSapiAttributes (DisplayAttributes displayAttributes) { return (byte) ((uint) displayAttributes >> 1); } internal static DisplayAttributes SapiAttributesToDisplayAttributes (byte sapiAttributes) { return (DisplayAttributes) (sapiAttributes << 1); } #endregion //******************************************************************* // // Internal Fields // //******************************************************************** #region Internal Fields internal TimeSpan _audioPosition; internal TimeSpan _audioDuration; #endregion //******************************************************************* // // Private Fields // //******************************************************************* #region Private Fields private string _text; private string _lexicalForm; private float _confidence; private string _pronunciation; private DisplayAttributes _displayAttributes; #endregion } /// TODOC [Flags] public enum DisplayAttributes { /// TODOC None = 0x00, /// TODOC ZeroTrailingSpaces = 0x02, /// TODOC OneTrailingSpace = 0x04, /// TODOC TwoTrailingSpaces = 0x08, /// TODOC ConsumeLeadingSpaces = 0x10, } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------- using System; using System.Diagnostics; using System.Speech.Internal; #pragma warning disable 1634, 1691 // Allows suppression of certain PreSharp messages. namespace System.Speech.Recognition { /// TODOC <_include file='doc\RecognitionResult.uex' path='docs/doc[@for="RecognizedWordUnit"]/*' /> [Serializable] [DebuggerDisplay ("Text: {Text}")] public class RecognizedWordUnit { //******************************************************************* // // Constructors // //******************************************************************* #region Constructors #pragma warning disable 6504 #pragma warning disable 6507 // Constructor for recognized 'word' /// TODOC <_include file='doc\RecognitionResult.uex' path='docs/doc[@for="RecognizedWordUnit.ctor"]/*' /> public RecognizedWordUnit (string text, float confidence, string pronunciation, string lexicalForm, DisplayAttributes displayAttributes, TimeSpan audioPosition, TimeSpan audioDuration) { if (lexicalForm == null) { throw new ArgumentNullException ("lexicalForm"); } if (confidence < 0.0f || confidence > 1.0f) { throw new ArgumentOutOfRangeException (SR.Get (SRID.InvalidConfidence)); } _text = text == null || text.Length == 0 ? null : text; _confidence = confidence; _pronunciation = pronunciation == null || pronunciation.Length == 0 ? null : pronunciation; _lexicalForm = lexicalForm; _displayAttributes = displayAttributes; _audioPosition = audioPosition; _audioDuration = audioDuration; } #pragma warning restore 6504 #pragma warning restore 6507 #endregion //******************************************************************** // // Public Properties // //******************************************************************* #region Public Properties // Spoken text of the word {No conversion to display form} /// TODOC <_include file='doc\RecognitionResult.uex' path='docs/doc[@for="RecognizedWordUnit.Text"]/*' /> public string Text { get { return _text; } } // Confidence score /// TODOC <_include file='doc\RecognitionResult.uex' path='docs/doc[@for="RecognizedWordUnit.Confidence"]/*' /> public float Confidence { get { return _confidence; } } /// TODOC <_include file='doc\RecognitionResult.uex' path='docs/doc[@for="RecognizedWordUnit.PronunciationString"]/*' /> public string Pronunciation { get { return _pronunciation; } } ////// TODOC /// public string LexicalForm { get { return _lexicalForm; } } ////// TODOC /// public DisplayAttributes DisplayAttributes { get { return _displayAttributes; } } #endregion //******************************************************************** // // Internal Methods // //******************************************************************** #region Internal Methods internal static byte DisplayAttributesToSapiAttributes (DisplayAttributes displayAttributes) { return (byte) ((uint) displayAttributes >> 1); } internal static DisplayAttributes SapiAttributesToDisplayAttributes (byte sapiAttributes) { return (DisplayAttributes) (sapiAttributes << 1); } #endregion //******************************************************************* // // Internal Fields // //******************************************************************** #region Internal Fields internal TimeSpan _audioPosition; internal TimeSpan _audioDuration; #endregion //******************************************************************* // // Private Fields // //******************************************************************* #region Private Fields private string _text; private string _lexicalForm; private float _confidence; private string _pronunciation; private DisplayAttributes _displayAttributes; #endregion } /// TODOC [Flags] public enum DisplayAttributes { /// TODOC None = 0x00, /// TODOC ZeroTrailingSpaces = 0x02, /// TODOC OneTrailingSpace = 0x04, /// TODOC TwoTrailingSpaces = 0x08, /// TODOC ConsumeLeadingSpaces = 0x10, } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ToolBar.cs
- ContextMenu.cs
- WpfKnownTypeInvoker.cs
- CompiledELinqQueryState.cs
- VolatileEnlistmentState.cs
- SchemaTypeEmitter.cs
- DragDrop.cs
- Pair.cs
- EntityDataSourceValidationException.cs
- AnonymousIdentificationModule.cs
- GreenMethods.cs
- MetabaseReader.cs
- ResourcesGenerator.cs
- SystemEvents.cs
- LoginView.cs
- GridViewDeleteEventArgs.cs
- DocumentOrderQuery.cs
- Behavior.cs
- TextLine.cs
- EnumMember.cs
- ComAdminWrapper.cs
- PropertyChangeTracker.cs
- PointAnimationUsingKeyFrames.cs
- Size3DConverter.cs
- Header.cs
- XmlSchemaExternal.cs
- XmlAttributeAttribute.cs
- SqlDataRecord.cs
- EntityDataSourceState.cs
- InputLanguageManager.cs
- DataPagerFieldCommandEventArgs.cs
- NativeRightsManagementAPIsStructures.cs
- HttpContext.cs
- MissingMethodException.cs
- UnauthorizedWebPart.cs
- SmiEventSink_DeferedProcessing.cs
- LinkedResource.cs
- MaskPropertyEditor.cs
- ListItemConverter.cs
- OleDbPropertySetGuid.cs
- SQlBooleanStorage.cs
- TrackBar.cs
- TypeEnumerableViewSchema.cs
- ByteStreamGeometryContext.cs
- MultiAsyncResult.cs
- TextRunCache.cs
- InheritanceContextChangedEventManager.cs
- Annotation.cs
- MouseOverProperty.cs
- DPCustomTypeDescriptor.cs
- ControlCodeDomSerializer.cs
- MethodExpr.cs
- WebPartUserCapability.cs
- ComponentDispatcherThread.cs
- Receive.cs
- SqlCacheDependencySection.cs
- RangeValidator.cs
- Int64KeyFrameCollection.cs
- PrivilegeNotHeldException.cs
- SQLInt64Storage.cs
- BitmapEffectrendercontext.cs
- CSharpCodeProvider.cs
- CssClassPropertyAttribute.cs
- DispatcherOperation.cs
- UITypeEditor.cs
- OwnerDrawPropertyBag.cs
- ContextMenuStrip.cs
- DeclarativeExpressionConditionDeclaration.cs
- ResourcesBuildProvider.cs
- WebPartConnectionsDisconnectVerb.cs
- ProfileGroupSettings.cs
- ImportedPolicyConversionContext.cs
- ErrorFormatter.cs
- ConfigurationManagerInternal.cs
- HostedHttpTransportManager.cs
- FloaterParaClient.cs
- XamlTypeMapperSchemaContext.cs
- WebPartZoneBase.cs
- UnicodeEncoding.cs
- SignatureDescription.cs
- DataGridItemEventArgs.cs
- DESCryptoServiceProvider.cs
- AdRotatorDesigner.cs
- ScrollProperties.cs
- PersonalizablePropertyEntry.cs
- ColumnMapVisitor.cs
- XmlnsCompatibleWithAttribute.cs
- EdmTypeAttribute.cs
- ArrangedElementCollection.cs
- AcceleratedTokenProvider.cs
- dsa.cs
- relpropertyhelper.cs
- DecryptedHeader.cs
- UrlPath.cs
- AmbientEnvironment.cs
- StructuredTypeInfo.cs
- LinqDataSourceInsertEventArgs.cs
- XmlWriterSettings.cs
- NativeBuffer.cs
- ExpressionPrefixAttribute.cs