Click here to Skip to main content
15,886,110 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 76K   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;
using System.Globalization;

namespace SpellChecker.Dictionary.Phonetic
{
	/// <summary>
	///		This class holds helper methods for phonetic encoding
	/// </summary>
	public sealed class PhoneticUtility
	{
		/// <summary>
		///     Initializes a new instance of the class
		/// </summary>
		private PhoneticUtility()
		{
		}

		/// <summary>
		///     Converts the rule text in to a PhoneticRule class
		/// </summary>
		/// <param name="ruleText" type="string">
		///     <para>
		///         The text to convert
		///     </para>
		/// </param>
		/// <param name="rule" type="ref SpellChecker.Dictionary.Phonetic.PhoneticRule">
		///     <para>
		///         The object that will hold the conversion data
		///     </para>
		/// </param>
		public static void EncodeRule(string ruleText, ref PhoneticRule rule)
		{
			// clear the conditions array
			for (int i=0; i < rule.Condition.Length; i++)
			{
				rule.Condition[i] = 0;
			}

			bool group = false;  /* group indicator */
			bool end = false;   /* end condition indicator */

			char [] memberChars = new char[200];
			int numMember = 0;   /* number of member in group */

			foreach (char cond in ruleText)
			{
				switch (cond) 
				{
					case '(' :
						group = true;
						break;
					case ')' :
						end = true;
						break;
					case '^' :
						rule.BeginningOnly = true;
						break;
					case '$' :
						rule.EndOnly = true;
						break;
					case '-' :
						rule.ConsumeCount++;
						break;
					case '<' :
						rule.ReplaceMode = true;
						break;
					case '0' :
					case '1' :
					case '2' :
					case '3' :
					case '4' :
					case '5' :
					case '6' :
					case '7' :
					case '8' :
					case '9' :
						rule.Priority = int.Parse(cond.ToString(CultureInfo.CurrentUICulture));
						break;
					default :
						if (group)
						{
							// add chars to group
							memberChars[numMember] = cond;
							numMember++;
						}
						else
						{
							end = true;
						}
						break;
				} // switch

				if (end)
				{
					if (group)
					{
						// turn on chars in member group
						for (int j=0; j < numMember; j++) 
						{
							int charCode = (int)memberChars[j];
							rule.Condition[charCode] = rule.Condition[charCode] | (1 << rule.ConditionCount);
						}

						group = false;
						numMember = 0;
					}
					else
					{
						// turn on char
						int charCode = (int)cond;
						rule.Condition[charCode] = rule.Condition[charCode] | (1 << rule.ConditionCount);
					}
					end = false;
					rule.ConditionCount++;
				} // if end
			} // for each
		}
	}
}

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