Exemple #1
0
        private void ApplyModifiers(IEnumerable <Capture> modifiers, StringBuilder sb, FeatureStruct fs)
        {
            var modStrs = new List <string>();

            foreach (Capture modifier in modifiers)
            {
                string modStr  = modifier.Value;
                Symbol modInfo = _modifiers[modStr];
                if (modInfo.FeatureStruct != null && !modInfo.FeatureStruct.IsEmpty)
                {
                    if (modInfo.Overwrite)
                    {
                        fs.PriorityUnion(modInfo.FeatureStruct);
                    }
                    else
                    {
                        fs.Add(modInfo.FeatureStruct);
                    }

                    if (modStr.Length == 1 && IsStackingDiacritic(modStr[0]))
                    {
                        sb.Append(modStr);
                    }
                    else
                    {
                        modStrs.Add(modStr);
                    }
                }
            }
            modStrs.OrderBy(str => str).Aggregate(sb, (s, modStr) => s.Append(modStr));
        }
Exemple #2
0
        private void ApplyModifiers(IEnumerable<Capture> modifiers, StringBuilder sb, FeatureStruct fs)
        {
            var modStrs = new List<string>();
            foreach (Capture modifier in modifiers)
            {
                string modStr = modifier.Value;
                Symbol modInfo = _modifiers[modStr];
                if (modInfo.FeatureStruct != null && !modInfo.FeatureStruct.IsEmpty)
                {
                    if (modInfo.Overwrite)
                        fs.PriorityUnion(modInfo.FeatureStruct);
                    else
                        fs.Add(modInfo.FeatureStruct);

                    if (modStr.Length == 1 && IsStackingDiacritic(modStr[0]))
                        sb.Append(modStr);
                    else
                        modStrs.Add(modStr);
                }
            }
            modStrs.OrderBy(str => str).Aggregate(sb, (s, modStr) => s.Append(modStr));
        }