Click here to Skip to main content
15,867,851 members
Articles / Artificial Intelligence / Neural Networks

Multiple convolution neural networks approach for online handwriting recognition

Rate me:
Please Sign up or sign in to vote.
4.95/5 (37 votes)
9 Apr 2013CPOL8 min read 74.6K   25.1K   74  
The research focuses on the presentation of word recognition technique for an online handwriting recognition system which uses multiple component neural networks (MCNN) as the exchangeable parts of the classifier.
using System;

namespace SpellChecker.Dictionary
{
	/// <summary>
	/// The Word class represents a base word in the dictionary
	/// </summary>
	public class Word  : IComparable
	{
		private string _AffixKeys = "";
		private int _EditDistance = 0;
		private int _height = 0;
		private int _index = 0;
		private string _PhoneticCode = "";
		private string _text = "";

		/// <summary>
		///     Initializes a new instance of the class
		/// </summary>
		public Word()
		{
		}

		/// <summary>
		///     Initializes a new instance of the class
		/// </summary>
		/// <param name="text" type="string">
		///     <para>
		///         The string for the base word
		///     </para>
		/// </param>
		/// <param name="affixKeys" type="string">
		///     <para>
		///         The affix keys that can be applied to this base word
		///     </para>
		/// </param>
		/// <param name="phoneticCode" type="string">
		///     <para>
		///         The phonetic code for this word
		///     </para>
		/// </param>
		public Word(string text, string affixKeys, string phoneticCode)
		{
			_text = text;
			_AffixKeys = affixKeys;
			_PhoneticCode = phoneticCode;
		}

		/// <summary>
		///     Initializes a new instance of the class
		/// </summary>
		/// <param name="text" type="string">
		///     <para>
		///         The string for the base word
		///     </para>
		/// </param>
		/// <param name="affixKeys" type="string">
		///     <para>
		///         The affix keys that can be applied to this base word
		///     </para>
		/// </param>
		public Word(string text, string affixKeys)
		{
			_text = text;
			_AffixKeys = affixKeys;
		}

		/// <summary>
		///     Initializes a new instance of the class
		/// </summary>
		/// <param name="text" type="string">
		///     <para>
		///         The string for the base word
		///     </para>
		/// </param>
		public Word(string text)
		{
			_text = text;
		}

		/// <summary>
		///     Initializes a new instance of the class
		/// </summary>
		/// <param name="text" type="string">
		///     <para>
		///         The string for the word
		///     </para>
		/// </param>
		/// <param name="index" type="int">
		///     <para>
		///         The position index of this word
		///     </para>
		/// </param>
		/// <param name="height" type="int">
		///     <para>
		///         The line height of this word
		///     </para>
		/// </param>
		/// <returns>
		///     A void value...
		/// </returns>
		internal Word(string text, int index, int height)
		{
			_text = text;
			_index = index;
			_height = height;
		}

		/// <summary>
		///     Initializes a new instance of the class
		/// </summary>
		/// <param name="text" type="string">
		///     <para>
		///         The string for the base word
		///     </para>
		/// </param>
		/// <param name="editDistance" type="int">
		///     <para>
		///         The edit distance from the misspelled word
		///     </para>
		/// </param>
		internal Word(string text, int editDistance)
		{
			_text = text;
			_EditDistance = editDistance;
		}

		/// <summary>
		///     Sorts a collection of words by EditDistance
		/// </summary>
		/// <remarks>
		///		The compare sorts in desc order, largest EditDistance first
		/// </remarks>
		public int CompareTo(object obj)
		{
			int result = this.EditDistance.CompareTo(((Word)obj).EditDistance);
			return result; // * -1; // sorts desc order
		}


		/// <summary>
		///     The affix keys that can be applied to this base word
		/// </summary>
		public string AffixKeys
		{
			get {return _AffixKeys;}
			set {_AffixKeys = value;}
		}

		
		/// <summary>
		///     The index position of where this word appears
		/// </summary>
		public int Index
		{
			get { return _index; }
			set { _index = value; }
		}

		/// <summary>
		///     The phonetic code for this word
		/// </summary>
		public string PhoneticCode
		{
			get {return _PhoneticCode;}
			set {_PhoneticCode = value;}
		}

		/// <summary>
		///     The string for the base word
		/// </summary>
		public string Text
		{
			get { return _text; }
			set { _text = value; }
		}	


		/// <summary>
		///     Used for sorting suggestions by its edit distance for 
		///     the misspelled word
		/// </summary>
		internal int EditDistance
		{
			get {return _EditDistance;}
			set {_EditDistance = value;}
		}

		/// <summary>
		///     The line height of this word
		/// </summary>
		internal int Height
		{
			get { return _height; }
			set { _height = value; }
		}

		/// <summary>
		///     Converts the word object to a string
		/// </summary>
		/// <returns>
		///		Returns the Text Property contents
		/// </returns>
		public override string ToString()
		{
			return _text;
		}
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Vietnam Maritime University
Vietnam Vietnam
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions