Decomp() public method

Get the decomposition list.
Get the decomposition list.
public Decomp ( ) : DecompList
return DecompList
Ejemplo n.º 1
0
 /// <summary>Decompose a string according to the given key.</summary>
 /// <remarks>
 /// Decompose a string according to the given key. Try each decomposition
 /// rule in order. If it matches, assemble a reply and return it. If assembly
 /// fails, try another decomposition rule. If assembly is a goto rule, return
 /// null and give the key. If assembly succeeds, return the reply;
 /// </remarks>
 private string Decompose(Key key, string s, Key gotoKey)
 {
     string[] reply = new string[10];
     for (int i = 0; i < key.Decomp().Count; i++)
     {
         Decomp d   = (Decomp)key.Decomp()[i];
         string pat = d.Pattern();
         if (syns.MatchDecomp(s, pat, reply))
         {
             string rep = Assemble(d, reply, gotoKey);
             if (rep != null)
             {
                 return(rep);
             }
             if (gotoKey.GetKey() != null)
             {
                 return(null);
             }
         }
     }
     return(null);
 }
Ejemplo n.º 2
0
 public virtual void Copy(Key k)
 {
     key    = k.GetKey();
     rank   = k.Rank();
     decomp = k.Decomp();
 }
Ejemplo n.º 3
0
		public virtual void Copy(Key k)
		{
			key = k.GetKey();
			rank = k.Rank();
			decomp = k.Decomp();
		}
Ejemplo n.º 4
0
		/// <summary>Decompose a string according to the given key.</summary>
		/// <remarks>
		/// Decompose a string according to the given key. Try each decomposition
		/// rule in order. If it matches, assemble a reply and return it. If assembly
		/// fails, try another decomposition rule. If assembly is a goto rule, return
		/// null and give the key. If assembly succeeds, return the reply;
		/// </remarks>
		private string Decompose(Key key, string s, Key gotoKey)
		{
			string[] reply = new string[10];
			for (int i = 0; i < key.Decomp().Count; i++)
			{
				Decomp d = (Decomp)key.Decomp()[i];
				string pat = d.Pattern();
				if (syns.MatchDecomp(s, pat, reply))
				{
					string rep = Assemble(d, reply, gotoKey);
					if (rep != null)
					{
						return rep;
					}
					if (gotoKey.GetKey() != null)
					{
						return null;
					}
				}
			}
			return null;
		}