コード例 #1
0
ファイル: Index.cs プロジェクト: smartree/Zydeo
        /// <summary>
        /// Ctor: deserializes binary data.
        /// </summary>
        public Index(BinReader br)
        {
            WordHolder = new CedictEngine.WordHolder(br);
            SenseIndex = new Dictionary <int, SenseIndexItem>();
            int senseIndexKeyCount = br.ReadInt();

            for (int i = 0; i != senseIndexKeyCount; ++i)
            {
                int            tokenId = br.ReadInt();
                SenseIndexItem sii     = new SenseIndexItem(br);
                SenseIndex[tokenId] = sii;
            }

            IdeoIndex   = new Dictionary <char, IdeoIndexItem>();
            PinyinIndex = new Dictionary <string, PinyinIndexItem>();

            int ideoIndexKeyCount = br.ReadInt();

            for (int i = 0; i != ideoIndexKeyCount; ++i)
            {
                char          c   = br.ReadChar();
                IdeoIndexItem iii = new IdeoIndexItem(br);
                IdeoIndex[c] = iii;
            }

            int pinyinIndexKeyCount = br.ReadInt();

            for (int i = 0; i != pinyinIndexKeyCount; ++i)
            {
                string          str = br.ReadString();
                PinyinIndexItem pyi = new PinyinIndexItem(br);
                PinyinIndex[str] = pyi;
            }
        }
コード例 #2
0
ファイル: Index.cs プロジェクト: smartree/Zydeo
 /// <summary>
 /// Ctor: creates an empty instance (used while compiling index).
 /// </summary>
 public Index()
 {
     WordHolder  = new WordHolder();
     SenseIndex  = new Dictionary <int, SenseIndexItem>();
     IdeoIndex   = new Dictionary <char, IdeoIndexItem>();
     PinyinIndex = new Dictionary <string, PinyinIndexItem>();
 }
コード例 #3
0
ファイル: Index.cs プロジェクト: sheeeng/Zydeo
        /// <summary>
        /// Ctor: deserializes binary data.
        /// </summary>
        public Index(BinReader br)
        {
            WordHolder = new CedictEngine.WordHolder(br);
            SenseIndex = new Dictionary<int, SenseIndexItem>();
            int senseIndexKeyCount = br.ReadInt();
            for (int i = 0; i != senseIndexKeyCount; ++i)
            {
                int tokenId = br.ReadInt();
                SenseIndexItem sii = new SenseIndexItem(br);
                SenseIndex[tokenId] = sii;
            }

            IdeoIndex = new Dictionary<char, IdeoIndexItem>();
            PinyinIndex = new Dictionary<string, PinyinIndexItem>();

            int ideoIndexKeyCount = br.ReadInt();
            for (int i = 0; i != ideoIndexKeyCount; ++i)
            {
                char c = br.ReadChar();
                IdeoIndexItem iii = new IdeoIndexItem(br);
                IdeoIndex[c] = iii;
            }

            int pinyinIndexKeyCount = br.ReadInt();
            for (int i = 0; i != pinyinIndexKeyCount; ++i)
            {
                string str = br.ReadString();
                PinyinIndexItem pyi = new PinyinIndexItem(br);
                PinyinIndex[str] = pyi;
            }
        }
コード例 #4
0
ファイル: Index.cs プロジェクト: sheeeng/Zydeo
 /// <summary>
 /// Ctor: creates an empty instance (used while compiling index).
 /// </summary>
 public Index()
 {
     WordHolder = new WordHolder();
     SenseIndex = new Dictionary<int, SenseIndexItem>();
     IdeoIndex = new Dictionary<char, IdeoIndexItem>();
     PinyinIndex = new Dictionary<string, PinyinIndexItem>();
 }
コード例 #5
0
 /// <summary>
 /// Ctor: takes word holder to work with.
 /// </summary>
 public Tokenizer(WordHolder wh)
 {
     this.wh = wh;
 }