Example #1
0
 /// <summary>
 ///     person.dic
 /// </summary>
 private void Init1()
 {
     TextReader br = null;
     try
     {
         _personNatureAttrs = new HashMap<string, PersonNatureAttr>();
         br = MyStaticValue.GetPersonReader();
         string temp;
         while ((temp = br.ReadLine()) != null)
         {
             var strs = temp.Split('\t');
             var pna = _personNatureAttrs[strs[0]];
             if (pna == null)
             {
                 pna = new PersonNatureAttr();
             }
             pna.AddFreq(int.Parse(strs[1]), int.Parse(strs[2]));
             _personNatureAttrs.Add(strs[0], pna);
         }
     }
     finally
     {
         if (br != null)
             br.Close();
     }
 }
Example #2
0
 /// <summary>
 ///     name_freq
 /// </summary>
 private void Init2()
 {
     var personFreqMap = MyStaticValue.GetPersonFreqMap();
     foreach (var entry in personFreqMap)
     {
         var pna = _personNatureAttrs[entry.Key];
         if (pna == null)
         {
             pna = new PersonNatureAttr();
             pna.SetlocFreq(entry.Value);
             _personNatureAttrs.Add(entry.Key, pna);
         }
         else
         {
             pna.SetlocFreq(entry.Value);
         }
     }
 }
Example #3
0
 public void SetPersonNatureAttr(PersonNatureAttr personAttr)
 {
     _personAttr = personAttr;
 }