Пример #1
0
        public override void Initialize(GrammarData grammarData)
        {
            base.Initialize(grammarData);
            //collect all suffixes, prefixes in lists and create sets of first chars for both
            Prefixes.Sort(StringList.LongerFirst);
            Suffixes.Sort(StringList.LongerFirst);

            _prefixesFirsts = new CharHashSet(CaseSensitivePrefixesSuffixes);
            _suffixesFirsts = new CharHashSet(CaseSensitivePrefixesSuffixes);
            foreach (var pfx in Prefixes)
            {
                _prefixesFirsts.Add(pfx[0]);
            }
            foreach (var sfx in Suffixes)
            {
                _suffixesFirsts.Add(sfx[0]);
            }
        }