Exemple #1
0
        static public IEnumerable <Rime19> GetAllByChar(CodePoint cp)
        {
            var    range = ESyllable.GetAllByChar(cp);
            Rime19 last  = new Rime19 {
                _i = 0xff
            };

            for (int i = 0; i < range.Count; ++i)
            {
                var syl  = range[i];
                var er   = ESection.GetByRime(syl.Final.Index, syl.Tone);
                var fork = _erTo19[er.Index];
                var curr = new Rime19 {
                    _i = (fork.First == 30 /*泰*/ && !syl.Final.Rounded) ? fork.Second : fork.First
                };

                if (!curr.Equals(last))
                {
                    yield return(last = curr);

                    if (fork.Count == 2 && (er.Title == '佳' || er.Title == '卦') && _jias.Contains(cp))
                    {
                        yield return(last = new Rime19 {
                            _i = fork.Second
                        });
                    }
                }
            }
        }
Exemple #2
0
        static public bool IsLevel(CodePoint cp)
        {
            var range = ESyllable.GetAllByChar(cp);

            for (int i = 0; i < range.Count; i++)
            {
                if (range[i].Tone == Tone.Level)
                {
                    return(true);
                }
            }
            return(false);
        }
Exemple #3
0
        static public IEnumerable <ESection> GetAllByChar(CodePoint cp)
        {
            var      r        = ESyllable.GetAllByChar(cp);
            ESection lastSect = new ESection {
                _i = 0xFF
            };

            for (int i = 0; i < r.Count; ++i)
            {
                var syl      = r[i];
                var currSect = GetByRime(syl.Final.Index, syl.Tone);
                if (!currSect.Equals(lastSect))
                {
                    lastSect = currSect;
                    yield return(currSect);
                }
            }
        }
Exemple #4
0
        public bool Contains(CodePoint cp)
        {
            bool test = false;
            var  r    = ESyllable.GetAllByChar(cp);
            int  cnt  = r.Count;

            if (cnt > 0)
            {
                for (int i = 0; i < cnt; i++)
                {
                    if (r[i].Section._i == _i)
                    {
                        test = true;
                        break;
                    }
                }
            }
            return(test);
        }