Exemple #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;
            }
        }
Exemple #2
0
 /// <summary>
 /// Ctor: read from binary stream.
 /// </summary>
 public TextRunLatin(BinReader br)
 {
     Text = br.ReadString();
 }
Exemple #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);
 }
Exemple #4
0
 public ZhoEmbedding(BinReader br)
 {
     Val = br.ReadULong();
 }