| 18 | using namespace ci; |
| 19 | |
| 20 | Dictionary::Dictionary( DataSourceRef dataSource ) |
| 21 | { |
| 22 | Buffer decompressed = decompressBuffer( Buffer( dataSource ), false, true ); |
| 23 | |
| 24 | // read out all the words, which are separated by lines and are already alphabetized |
| 25 | IStreamMemRef stream = IStreamMem::create( decompressed.getData(), decompressed.getSize() ); |
| 26 | while( ! stream->isEof() ) |
| 27 | mWords.push_back( stream->readLine() ); |
| 28 | } |
| 29 | |
| 30 | // Functor used to determine whether the prefix of length 'compareLength' of two words are the same |
| 31 | struct CompareStringPrefix { |