Decomp() public method

Get the decomposition list.
Get the decomposition list.
public Decomp ( ) : DecompList
return DecompList
Beispiel #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);
 }
Beispiel #2
0
 public virtual void Copy(Key k)
 {
     key    = k.GetKey();
     rank   = k.Rank();
     decomp = k.Decomp();
 }
Beispiel #3
0
		public virtual void Copy(Key k)
		{
			key = k.GetKey();
			rank = k.Rank();
			decomp = k.Decomp();
		}
Beispiel #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;
		}