Esempio n. 1
0
        /// <summary>
        /// Ctor: read from binary stream.
        /// </summary>
        public TextRunZho(BinReader br)
        {
            // Read flags
            // 1: Traditional and simplified are different
            // 2: Pinyin present
            byte flags = br.ReadByte();

            // Read simplified
            if ((flags & 1) == 1)
            {
                Simp = br.ReadString();
            }
            // Is traditional different?
            if ((flags & 2) == 2)
            {
                Trad = br.ReadString();
            }
            else
            {
                Trad = Simp;
            }
            // Is pinyin present?
            if ((flags & 4) == 4)
            {
                int pinyinCount = (int)br.ReadByte();
                Pinyin = new PinyinSyllable[pinyinCount];
                for (int i = 0; i != pinyinCount; ++i)
                {
                    Pinyin[i] = new PinyinSyllable(br);
                }
            }
            else
            {
                Pinyin = null;
            }
        }
Esempio n. 2
0
 /// <summary>
 /// Ctor: read from binary stream.
 /// </summary>
 public TextRunLatin(BinReader br)
 {
     Text = br.ReadString();
 }
Esempio n. 3
0
 /// <summary>
 /// Ctor: read from binary stream.
 /// </summary>
 public CedictSense(BinReader br)
 {
     Domain = HybridText.Deserialize(br);
     Equiv  = HybridText.Deserialize(br);
     Note   = HybridText.Deserialize(br);
 }
Esempio n. 4
0
 public ZhoEmbedding(BinReader br)
 {
     Val = br.ReadULong();
 }