예제 #1
0
 /// <summary>
 /// Applies the specified variables to the specified feature bundle.
 /// </summary>
 /// <param name="fb">The feature bundle.</param>
 /// <param name="variables">The variables.</param>
 /// <param name="instantiatedVars">The instantiated variables.</param>
 /// <param name="val">if <c>true</c> the feature bundle values will be set, otherwise they will be unset.</param>
 public void Apply(FeatureBundle fb, IDictionary <string, bool> variables, VariableValues instantiatedVars, bool val)
 {
     foreach (KeyValuePair <string, bool> varPolarity in variables)
     {
         foreach (FeatureValue value in GetVarFeatValue(varPolarity.Key, varPolarity.Value, instantiatedVars))
         {
             fb.Set(value, val);
         }
     }
 }
예제 #2
0
 /// <summary>
 /// Applies the specified variables that occur in the instantiated variables to the specified feature bundle.
 /// </summary>
 /// <param name="fb">The feature bundle.</param>
 /// <param name="variables">The variables.</param>
 /// <param name="instantiatedVars">The instantiated variables.</param>
 public void ApplyCurrent(FeatureBundle fb, IDictionary <string, bool> variables, VariableValues instantiatedVars)
 {
     foreach (KeyValuePair <string, bool> varPolarity in variables)
     {
         Feature feature = m_varFeatures[varPolarity.Key];
         ICollection <FeatureValue> varValues = instantiatedVars.GetValues(varPolarity.Key);
         if (varValues.Count > 0)
         {
             foreach (FeatureValue value in GetCurVarFeatValue(feature, varValues, varPolarity.Value))
             {
                 fb.Set(value, true);
             }
         }
     }
 }
예제 #3
0
		/// <summary>
		/// Applies the specified variables to the specified feature bundle.
		/// </summary>
		/// <param name="fb">The feature bundle.</param>
		/// <param name="variables">The variables.</param>
		/// <param name="instantiatedVars">The instantiated variables.</param>
		/// <param name="val">if <c>true</c> the feature bundle values will be set, otherwise they will be unset.</param>
		public void Apply(FeatureBundle fb, IDictionary<string, bool> variables, VariableValues instantiatedVars, bool val)
		{
			foreach (KeyValuePair<string, bool> varPolarity in variables)
			{
				foreach (FeatureValue value in GetVarFeatValue(varPolarity.Key, varPolarity.Value, instantiatedVars))
					fb.Set(value, val);
			}
		}
예제 #4
0
		/// <summary>
		/// Applies the specified variables that occur in the instantiated variables to the specified feature bundle.
		/// </summary>
		/// <param name="fb">The feature bundle.</param>
		/// <param name="variables">The variables.</param>
		/// <param name="instantiatedVars">The instantiated variables.</param>
		public void ApplyCurrent(FeatureBundle fb, IDictionary<string, bool> variables, VariableValues instantiatedVars)
		{
			foreach (KeyValuePair<string, bool> varPolarity in variables)
			{
				Feature feature = m_varFeatures[varPolarity.Key];
				ICollection<FeatureValue> varValues = instantiatedVars.GetValues(varPolarity.Key);
				if (varValues.Count > 0)
				{
					foreach (FeatureValue value in GetCurVarFeatValue(feature, varValues, varPolarity.Value))
						fb.Set(value, true);
				}
			}
		}