Esempio n. 1
0
        private void readReading(EdictEntryBuilder entry, XmlReader xml)
        {
            string        text = null;
            double        mult = 1.0;
            List <string> misc = null;

            while (xml.Read())
            {
                if (xml.NodeType == XmlNodeType.EndElement)
                {
                    if (xml.Name == "r_ele")
                    {
                        break;
                    }
                }
                if (xml.NodeType == XmlNodeType.Element)
                {
                    string name = xml.Name;
                    switch (name)
                    {
                    case "reb":
                        text = xml.ReadString();
                        break;

                    case "re_nokanji":
                        mult = 1.5;
                        break;

                    case "re_restr":
                        // ignore for now
                        break;

                    case "re_inf":
                        if (misc == null)
                        {
                            misc = new List <string>();
                        }
                        misc.Add(fromEntity(xml));
                        break;

                    case "re_pri":
                        string priority = xml.ReadString();
                        entry.addPriority(priority);
                        if (mult > 0)
                        {
                            mult = Math.Max(mult, getMultiplierFromCode(priority));
                        }
                        break;
                    }
                }
            }
            if (text != null)
            {
                DictionaryKeyBuilder s = new DictionaryKeyBuilder(text, mult, misc);
                entry.addKana(s);
            }
        }
Esempio n. 2
0
 private void readReading(EdictEntryBuilder entry, XmlReader xml)
 {
     string text = null;
     double mult = 1.0;
     List<string> misc = null;
     while (xml.Read()) {
         if (xml.NodeType == XmlNodeType.EndElement) {
             if (xml.Name == "r_ele") {
                 break;
             }
         }
         if (xml.NodeType == XmlNodeType.Element) {
             string name = xml.Name;
             switch (name) {
                 case "reb":
                     text = xml.ReadString();
                     break;
                 case "re_nokanji":
                     mult = 1.5;
                     break;
                 case "re_restr":
                     // ignore for now
                     break;
                 case "re_inf":
                     if (misc == null) misc = new List<string>();
                     misc.Add(fromEntity(xml));
                     break;
                 case "re_pri":
                     string priority = xml.ReadString();
                     entry.addPriority(priority);
                     if (mult > 0) {
                         mult = Math.Max(mult, getMultiplierFromCode(priority));
                     }
                     break;
             }
         }
     }
     if (text != null) {
         DictionaryKeyBuilder s = new DictionaryKeyBuilder(text, mult, misc);
         entry.addKana(s);
     }
 }
Esempio n. 3
0
 public void addKana(DictionaryKeyBuilder kana)
 {
     this.kana.Add(kana);
 }
Esempio n. 4
0
 public void addKanji(DictionaryKeyBuilder kanji)
 {
     this.kanji.Add(kanji);
 }