Ejemplo n.º 1
0
        public void Test()
        {
            Type rootDictionary = typeof(RootDictionary);

            Type affixDictionary = typeof(EoAffixes);

            MemberInfo[] roots   = rootDictionary.GetFields();
            MemberInfo[] affixes = affixDictionary.GetFields();

            foreach (MemberInfo info in roots)
            {
                foreach (MemberInfo affixInfo in affixes)
                {
                    object rootObject  = rootDictionary.InvokeMember(info.Name, BindingFlags.GetField, null, null, null);
                    object affixObject = affixDictionary.InvokeMember(affixInfo.Name, BindingFlags.GetField, null, null, null);

                    if (rootObject is EoRoot && affixObject is EoAffix)
                    {
                        EoRoot  root  = rootObject as EoRoot;
                        EoAffix affix = affixObject as EoAffix;
                        //EoWord w = new EoWord(root, 'o');
                        //Console.WriteLine(w);
                        EoWord w2 = new EoWord(new[] { root }, new[] { affix }, 'i');
                        Console.WriteLine(w2);
                    }
                }
            }
        }
Ejemplo n.º 2
0
 public EoWord(EoRoot root, char partOfSpeech)
 {
     text = String.Join("", root) + partOfSpeech;
 }