/// <summary> /// Initializes a new instance of the <see cref="BlockingTrace"/> class. /// </summary> /// <param name="mprFeatureType">Type: required or excluded.</param> /// <param name="mprFeatures">The set of MPR features the form has.</param> /// <param name="constrainingMPRFeatures">The set of MPR features the form must have (required) or must not have (excluded).</param> internal PhonologicalRuleSynthesisMPRFeaturesTrace(MPRFeaturesType mprFeatureType, MPRFeatureSet mprFeatures, MPRFeatureSet constrainingMPRFeatures) { m_mprFeatureType = mprFeatureType; m_mprFeatures = mprFeatures; m_constrainingMPRFeatures = constrainingMPRFeatures; }
public override void PhonologicalRuleNotApplicableMPRFeatures(MPRFeaturesType type, WordSynthesis input, MPRFeatureSet mprFeatures) { if (m_currentSynthesisPruleTrace != null) m_currentSynthesisPruleTrace.AddChild(new PhonologicalRuleSynthesisMPRFeaturesTrace(type, input.MPRFeatures, mprFeatures)); }
public abstract void PhonologicalRuleNotApplicableMPRFeatures(MPRFeaturesType type, WordSynthesis input, MPRFeatureSet mprFeatures);
public override void PhonologicalRuleNotApplicableMPRFeatures(MPRFeaturesType type, WordSynthesis input, MPRFeatureSet mprFeatures) { if (m_currentSynthesisPruleTrace != null) { m_currentSynthesisPruleTrace.Add(new XElement("PhonologicalRuleSynthesisMPRFeaturesTrace", new XAttribute("type", type == MPRFeaturesType.EXCLUDED ? "excluded" : "required"), new XElement("PhonologicalRuleMPRFeatures", input.MPRFeatures.Select(f => Write("PhonologicalRuleMPRFeature", f))), new XElement("PhonologicalRuleConstrainingMPRFeatrues", mprFeatures.Select(f => Write("PhonologicalRuleMPRFeature", f))))); } }
MPRFeatureSet LoadMPRFeatures(string mprFeatIdsStr) { if (string.IsNullOrEmpty(mprFeatIdsStr)) return null; MPRFeatureSet result = new MPRFeatureSet(); string[] mprFeatIds = mprFeatIdsStr.Split(' '); foreach (string mprFeatId in mprFeatIds) { MPRFeature mprFeat = m_curMorpher.GetMPRFeature(mprFeatId); if (mprFeat == null) throw CreateUndefinedObjectException(string.Format(HCStrings.kstidUnknownMPRFeat, mprFeatId), mprFeatId); result.Add(mprFeat); } return result; }