示例#1
0
        public void DumpToDatabase(DbConnection connection, Document doc)
        {
            IDictionaryEnumerator e = table.GetEnumerator();

            while (e.MoveNext())
            {
                // Get the DB word:
                string wordText = (string)e.Key;
                Word   word     = Word.Load(connection, wordText);
                if (word == null)
                {
                    word = new Word(wordText);
                    word.Insert(connection);
                }

                // Store the counter.
                Counter      cnt  = (Counter)e.Value;
                WordInstance inst = new WordInstance(word.Code, doc.Code, cnt.Count, cnt.Positions);
                inst.Insert(connection);
            }
        }
示例#2
0
        public void DumpToDatabase(DbConnection connection , Document doc)
        {
            IDictionaryEnumerator e = table.GetEnumerator();
            while (e.MoveNext())
            {
                // Get the DB word:
                string wordText = (string)e.Key;
                Word word = Word.Load(connection, wordText);
                if (word == null)
                {
                    word = new Word(wordText);
                    word.Insert(connection);
                }

                // Store the counter.
                Counter cnt = (Counter)e.Value;
                WordInstance inst = new WordInstance(word.Code, doc.Code, cnt.Count, cnt.Positions);
                inst.Insert(connection);
            }
        }