3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Stefan Schimanski
8 * Full author contact details are available in file CREDITS.
15 #include "support/convert.h"
16 #include "support/debug.h"
17 #include "support/docstring.h"
18 #include "support/weighted_btree.h"
20 #include <boost/assert.hpp>
25 struct WordList::Impl {
29 typedef stx::weighted_btree<docstring, size_t> Words;
41 for (size_t i = 1000000; i > 0; --i) {
42 d->words_.insert("a" + convert<docstring>(i), size_t(1), stx::Void());
54 docstring const & WordList::word(size_t idx) const
56 Impl::Words::const_iterator it = d->words_.find_summed_weight(idx);
57 BOOST_ASSERT(it != d->words_.end());
62 size_t WordList::size() const
64 return d->words_.size();
68 void WordList::insert(docstring const & w)
70 d->words_.insert(w, size_t(1), stx::Void());