paul@44 | 1 | #!/usr/bin/env python |
paul@44 | 2 | |
paul@44 | 3 | """ |
paul@44 | 4 | Specific classes for storing position information. |
paul@44 | 5 | |
paul@69 | 6 | Copyright (C) 2009, 2010 Paul Boddie <paul@boddie.org.uk> |
paul@44 | 7 | |
paul@44 | 8 | This program is free software; you can redistribute it and/or modify it under |
paul@44 | 9 | the terms of the GNU General Public License as published by the Free Software |
paul@44 | 10 | Foundation; either version 3 of the License, or (at your option) any later |
paul@44 | 11 | version. |
paul@44 | 12 | |
paul@44 | 13 | This program is distributed in the hope that it will be useful, but WITHOUT ANY |
paul@44 | 14 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A |
paul@44 | 15 | PARTICULAR PURPOSE. See the GNU General Public License for more details. |
paul@44 | 16 | |
paul@44 | 17 | You should have received a copy of the GNU General Public License along |
paul@44 | 18 | with this program. If not, see <http://www.gnu.org/licenses/>. |
paul@44 | 19 | """ |
paul@44 | 20 | |
paul@44 | 21 | from iixr.files import * |
paul@71 | 22 | from iixr.data import vint, vint_to_array, string_to_array |
paul@56 | 23 | from array import array |
paul@44 | 24 | |
paul@44 | 25 | class PositionWriter(FileWriter): |
paul@44 | 26 | |
paul@44 | 27 | "Writing position information to files." |
paul@44 | 28 | |
paul@44 | 29 | def reset(self): |
paul@44 | 30 | self.last_docnum = 0 |
paul@44 | 31 | |
paul@44 | 32 | def write_positions(self, docnum, positions): |
paul@44 | 33 | |
paul@44 | 34 | """ |
paul@44 | 35 | Write for the document 'docnum' the given 'positions'. |
paul@44 | 36 | """ |
paul@44 | 37 | |
paul@44 | 38 | if docnum < self.last_docnum: |
paul@44 | 39 | raise ValueError, "Document number %r is less than previous number %r." % (docnum, self.last_docnum) |
paul@44 | 40 | |
paul@44 | 41 | # Make sure that the positions are sorted. |
paul@44 | 42 | |
paul@44 | 43 | positions.sort() |
paul@44 | 44 | |
paul@52 | 45 | # Write the document number delta. |
paul@52 | 46 | # Write the number of positions. |
paul@52 | 47 | |
paul@56 | 48 | output = array('B') |
paul@56 | 49 | vint_to_array(docnum - self.last_docnum, output) |
paul@56 | 50 | vint_to_array(len(positions), output) |
paul@52 | 51 | |
paul@44 | 52 | # Write the position deltas. |
paul@44 | 53 | |
paul@44 | 54 | last = 0 |
paul@44 | 55 | |
paul@71 | 56 | # Handle tuples incorporating preceding text. |
paul@71 | 57 | |
paul@71 | 58 | for position, preceding in positions: |
paul@56 | 59 | vint_to_array(position - last, output) |
paul@71 | 60 | string_to_array(preceding, output) |
paul@44 | 61 | last = position |
paul@44 | 62 | |
paul@56 | 63 | output.tofile(self.f) |
paul@44 | 64 | |
paul@44 | 65 | self.last_docnum = docnum |
paul@44 | 66 | |
paul@69 | 67 | class PositionReader(FileReader): |
paul@69 | 68 | |
paul@69 | 69 | "Reading position information within term-specific regions of a file." |
paul@69 | 70 | |
paul@69 | 71 | def reset(self): |
paul@69 | 72 | self.last_docnum = 0 |
paul@69 | 73 | |
paul@69 | 74 | def read_positions(self): |
paul@69 | 75 | |
paul@69 | 76 | "Read positions, returning a document number and a list of positions." |
paul@69 | 77 | |
paul@69 | 78 | # Read the document number delta and add it to the last number. |
paul@69 | 79 | |
paul@69 | 80 | self.last_docnum += self.read_number() |
paul@69 | 81 | |
paul@69 | 82 | # Read the number of positions. |
paul@69 | 83 | |
paul@69 | 84 | npositions = self.read_number() |
paul@69 | 85 | |
paul@69 | 86 | # Read the position deltas, adding each previous position to get the |
paul@69 | 87 | # appropriate collection of absolute positions. |
paul@69 | 88 | |
paul@69 | 89 | i = 0 |
paul@69 | 90 | last = 0 |
paul@69 | 91 | positions = [] |
paul@69 | 92 | |
paul@69 | 93 | while i < npositions: |
paul@69 | 94 | last += self.read_number() |
paul@71 | 95 | preceding = self.read_string() |
paul@71 | 96 | positions.append((last, preceding)) |
paul@69 | 97 | i += 1 |
paul@69 | 98 | |
paul@69 | 99 | return self.last_docnum, positions |
paul@69 | 100 | |
paul@44 | 101 | class PositionIndexWriter(FileWriter): |
paul@44 | 102 | |
paul@44 | 103 | "Writing position index information to files." |
paul@44 | 104 | |
paul@44 | 105 | def reset(self): |
paul@44 | 106 | self.last_docnum = 0 |
paul@44 | 107 | self.last_pos_offset = 0 |
paul@44 | 108 | |
paul@44 | 109 | def write_positions(self, docnum, pos_offset, count): |
paul@44 | 110 | |
paul@44 | 111 | """ |
paul@44 | 112 | Write the given 'docnum, 'pos_offset' and document 'count' to the |
paul@44 | 113 | position index file. |
paul@44 | 114 | """ |
paul@44 | 115 | |
paul@44 | 116 | # Write the document number delta. |
paul@44 | 117 | # Write the position file offset delta. |
paul@44 | 118 | # Write the document count. |
paul@44 | 119 | |
paul@57 | 120 | output = array('B') |
paul@57 | 121 | vint_to_array(docnum - self.last_docnum, output) |
paul@57 | 122 | vint_to_array(pos_offset - self.last_pos_offset, output) |
paul@57 | 123 | vint_to_array(count, output) |
paul@44 | 124 | |
paul@44 | 125 | # Actually write the data. |
paul@44 | 126 | |
paul@57 | 127 | output.tofile(self.f) |
paul@44 | 128 | |
paul@52 | 129 | self.last_pos_offset = pos_offset |
paul@52 | 130 | self.last_docnum = docnum |
paul@44 | 131 | |
paul@69 | 132 | class PositionIndexReader(FileReader): |
paul@68 | 133 | |
paul@69 | 134 | "Reading position index information within term-specific regions of a file." |
paul@44 | 135 | |
paul@44 | 136 | def reset(self): |
paul@44 | 137 | self.last_docnum = 0 |
paul@44 | 138 | self.last_pos_offset = 0 |
paul@68 | 139 | |
paul@44 | 140 | def read_positions(self): |
paul@44 | 141 | |
paul@44 | 142 | """ |
paul@44 | 143 | Read a document number, a position file offset for the position index |
paul@44 | 144 | file, and the number of documents in a section of that file. |
paul@44 | 145 | """ |
paul@44 | 146 | |
paul@44 | 147 | # Read the document number delta. |
paul@44 | 148 | |
paul@44 | 149 | self.last_docnum += self.read_number() |
paul@44 | 150 | |
paul@44 | 151 | # Read the offset delta. |
paul@44 | 152 | |
paul@44 | 153 | self.last_pos_offset += self.read_number() |
paul@44 | 154 | |
paul@44 | 155 | # Read the document count. |
paul@44 | 156 | |
paul@44 | 157 | count = self.read_number() |
paul@44 | 158 | |
paul@44 | 159 | return self.last_docnum, self.last_pos_offset, count |
paul@44 | 160 | |
paul@69 | 161 | # Iterators for position-related files. |
paul@69 | 162 | |
paul@69 | 163 | class IteratorBase: |
paul@69 | 164 | |
paul@69 | 165 | "Support for iterating over results." |
paul@69 | 166 | |
paul@69 | 167 | def __init__(self, reader): |
paul@69 | 168 | |
paul@69 | 169 | "Initialise the iterator using the given 'reader'." |
paul@69 | 170 | |
paul@69 | 171 | self.reader = reader |
paul@69 | 172 | self.replenish(0) # no iteration initially permitted |
paul@69 | 173 | |
paul@69 | 174 | def replenish(self, count): |
paul@69 | 175 | |
paul@69 | 176 | "Replenish the iterator with 'count' results." |
paul@69 | 177 | |
paul@69 | 178 | self.count = count |
paul@69 | 179 | self.read_documents = 0 |
paul@69 | 180 | |
paul@69 | 181 | def __len__(self): |
paul@69 | 182 | |
paul@69 | 183 | "Return the total number of results." |
paul@69 | 184 | |
paul@69 | 185 | return self.count |
paul@69 | 186 | |
paul@69 | 187 | def sort(self): |
paul@69 | 188 | pass # Stored document positions are already sorted. |
paul@69 | 189 | |
paul@69 | 190 | def __iter__(self): |
paul@69 | 191 | return self |
paul@69 | 192 | |
paul@69 | 193 | class PositionIterator(IteratorBase): |
paul@69 | 194 | |
paul@69 | 195 | "Iterating over document positions." |
paul@69 | 196 | |
paul@69 | 197 | def replenish(self, count): |
paul@69 | 198 | IteratorBase.replenish(self, count) |
paul@69 | 199 | |
paul@69 | 200 | # Fill a cache of positions. |
paul@69 | 201 | |
paul@69 | 202 | self.cache = [] |
paul@69 | 203 | n = 0 |
paul@69 | 204 | |
paul@69 | 205 | while n < self.count: |
paul@69 | 206 | self.cache.append(self.reader.read_positions()) |
paul@69 | 207 | n += 1 |
paul@69 | 208 | |
paul@69 | 209 | def seek(self, offset, count): |
paul@69 | 210 | |
paul@69 | 211 | """ |
paul@69 | 212 | Seek to 'offset' in the file, limiting the number of documents available |
paul@69 | 213 | for reading to 'count'. |
paul@69 | 214 | """ |
paul@69 | 215 | |
paul@69 | 216 | self.reader.seek(offset) |
paul@69 | 217 | self.replenish(count) |
paul@69 | 218 | |
paul@44 | 219 | def next(self): |
paul@44 | 220 | |
paul@44 | 221 | "Read positions for a single document." |
paul@44 | 222 | |
paul@44 | 223 | if self.read_documents < self.count: |
paul@69 | 224 | positions = self.cache[self.read_documents] |
paul@69 | 225 | self.read_documents += 1 |
paul@69 | 226 | return positions |
paul@69 | 227 | else: |
paul@69 | 228 | raise StopIteration |
paul@69 | 229 | |
paul@69 | 230 | class PositionIndexIterator(IteratorBase): |
paul@69 | 231 | |
paul@69 | 232 | "Iterating over document positions." |
paul@69 | 233 | |
paul@69 | 234 | def replenish(self, count): |
paul@69 | 235 | IteratorBase.replenish(self, count) |
paul@69 | 236 | |
paul@69 | 237 | # Fill a cache of offsets. |
paul@69 | 238 | |
paul@69 | 239 | self.cache = [] |
paul@69 | 240 | self.current = 0 |
paul@69 | 241 | n = 0 |
paul@69 | 242 | |
paul@69 | 243 | while n < self.count: |
paul@69 | 244 | docnum, pos_offset, section_count = t = self.reader.read_positions() |
paul@69 | 245 | self.cache.append(t) |
paul@69 | 246 | n += section_count |
paul@69 | 247 | |
paul@69 | 248 | def seek(self, offset, doc_frequency): |
paul@69 | 249 | |
paul@69 | 250 | """ |
paul@69 | 251 | Seek to 'offset' in the file, limiting the number of documents available |
paul@69 | 252 | for reading to 'doc_frequency'. |
paul@69 | 253 | """ |
paul@69 | 254 | |
paul@69 | 255 | self.reader.seek(offset) |
paul@69 | 256 | self.replenish(doc_frequency) |
paul@69 | 257 | |
paul@69 | 258 | def next(self): |
paul@69 | 259 | |
paul@69 | 260 | "Read positions for a single document." |
paul@69 | 261 | |
paul@69 | 262 | if self.current < len(self.cache): |
paul@69 | 263 | docnum, pos_offset, self.section_count = t = self.cache[self.current] |
paul@69 | 264 | self.current += 1 |
paul@44 | 265 | return t |
paul@44 | 266 | else: |
paul@44 | 267 | raise StopIteration |
paul@44 | 268 | |
paul@44 | 269 | class PositionDictionaryWriter: |
paul@44 | 270 | |
paul@44 | 271 | "Writing position dictionaries." |
paul@44 | 272 | |
paul@44 | 273 | def __init__(self, position_writer, position_index_writer, interval): |
paul@44 | 274 | self.position_writer = position_writer |
paul@44 | 275 | self.position_index_writer = position_index_writer |
paul@44 | 276 | self.interval = interval |
paul@44 | 277 | |
paul@44 | 278 | def write_term_positions(self, doc_positions): |
paul@44 | 279 | |
paul@44 | 280 | """ |
paul@44 | 281 | Write all 'doc_positions' - a collection of tuples of the form (document |
paul@44 | 282 | number, position list) - to the file. |
paul@44 | 283 | |
paul@44 | 284 | Add some records to the index, making dictionary entries. |
paul@44 | 285 | |
paul@44 | 286 | Return a tuple containing the offset of the written data, the frequency |
paul@44 | 287 | (number of positions), and document frequency (number of documents) for |
paul@44 | 288 | the term involved. |
paul@44 | 289 | """ |
paul@44 | 290 | |
paul@44 | 291 | # Reset the writers. |
paul@44 | 292 | |
paul@44 | 293 | self.position_writer.reset() |
paul@44 | 294 | self.position_index_writer.reset() |
paul@44 | 295 | |
paul@55 | 296 | # Remember the first index entry offset. |
paul@55 | 297 | |
paul@55 | 298 | index_offset = self.position_index_writer.f.tell() |
paul@44 | 299 | |
paul@44 | 300 | # Write the positions. |
paul@44 | 301 | |
paul@44 | 302 | frequency = 0 |
paul@44 | 303 | count = 0 |
paul@44 | 304 | |
paul@55 | 305 | if doc_positions: |
paul@44 | 306 | |
paul@44 | 307 | # Retain the first record offset for a subsequent index entry. |
paul@44 | 308 | |
paul@55 | 309 | first_offset = self.position_writer.f.tell() |
paul@55 | 310 | first_docnum = None |
paul@44 | 311 | |
paul@55 | 312 | doc_positions.sort() |
paul@44 | 313 | |
paul@55 | 314 | for docnum, positions in doc_positions: |
paul@55 | 315 | if first_docnum is None: |
paul@55 | 316 | first_docnum = docnum |
paul@44 | 317 | |
paul@55 | 318 | self.position_writer.write_positions(docnum, positions) |
paul@44 | 319 | |
paul@55 | 320 | frequency += len(positions) |
paul@55 | 321 | count += 1 |
paul@55 | 322 | |
paul@55 | 323 | # Every {interval} entries, write an index entry. |
paul@44 | 324 | |
paul@55 | 325 | if count % self.interval == 0: |
paul@44 | 326 | |
paul@55 | 327 | self.position_index_writer.write_positions(first_docnum, first_offset, self.interval) |
paul@44 | 328 | |
paul@55 | 329 | first_offset = self.position_writer.f.tell() |
paul@55 | 330 | first_docnum = None |
paul@44 | 331 | |
paul@55 | 332 | # Reset the position writer so that position readers accessing |
paul@55 | 333 | # a section start with the correct document number. |
paul@55 | 334 | |
paul@55 | 335 | self.position_writer.reset() |
paul@44 | 336 | |
paul@55 | 337 | # Finish writing an index entry for the remaining documents. |
paul@44 | 338 | |
paul@55 | 339 | else: |
paul@55 | 340 | if first_docnum is not None: |
paul@55 | 341 | self.position_index_writer.write_positions(first_docnum, first_offset, count % self.interval) |
paul@44 | 342 | |
paul@44 | 343 | return index_offset, frequency, count |
paul@44 | 344 | |
paul@44 | 345 | def close(self): |
paul@44 | 346 | self.position_writer.close() |
paul@44 | 347 | self.position_index_writer.close() |
paul@44 | 348 | |
paul@44 | 349 | class PositionDictionaryReader: |
paul@44 | 350 | |
paul@69 | 351 | "Access to position dictionary entries through iterators." |
paul@44 | 352 | |
paul@68 | 353 | def __init__(self, position_reader, position_index_reader): |
paul@68 | 354 | self.position_reader = position_reader |
paul@68 | 355 | self.position_index_reader = position_index_reader |
paul@69 | 356 | |
paul@69 | 357 | def read_term_positions(self, offset, doc_frequency): |
paul@69 | 358 | iterator = PositionDictionaryIterator( |
paul@69 | 359 | PositionIterator(self.position_reader), |
paul@69 | 360 | PositionIndexIterator(self.position_index_reader) |
paul@69 | 361 | ) |
paul@69 | 362 | iterator.seek(offset, doc_frequency) |
paul@69 | 363 | return iterator |
paul@69 | 364 | |
paul@69 | 365 | def close(self): |
paul@69 | 366 | self.position_reader.close() |
paul@69 | 367 | self.position_index_reader.close() |
paul@69 | 368 | |
paul@69 | 369 | class PositionDictionaryIterator: |
paul@69 | 370 | |
paul@69 | 371 | "Iteration over position dictionary entries." |
paul@69 | 372 | |
paul@69 | 373 | def __init__(self, position_iterator, position_index_iterator): |
paul@69 | 374 | self.position_iterator = position_iterator |
paul@69 | 375 | self.position_index_iterator = position_index_iterator |
paul@68 | 376 | self.reset() |
paul@47 | 377 | |
paul@68 | 378 | def reset(self): |
paul@47 | 379 | |
paul@44 | 380 | # Remember the last values. |
paul@44 | 381 | |
paul@44 | 382 | self.found_docnum, self.found_positions = None, None |
paul@44 | 383 | |
paul@44 | 384 | # Maintain state for the next index entry, if read. |
paul@44 | 385 | |
paul@44 | 386 | self.next_docnum, self.next_pos_offset, self.next_section_count = None, None, None |
paul@44 | 387 | |
paul@68 | 388 | def seek(self, offset, doc_frequency): |
paul@68 | 389 | |
paul@68 | 390 | """ |
paul@68 | 391 | Seek to 'offset' in the index file, limiting the number of documents |
paul@68 | 392 | available for reading to 'doc_frequency'. |
paul@68 | 393 | """ |
paul@68 | 394 | |
paul@68 | 395 | self.reset() |
paul@68 | 396 | |
paul@68 | 397 | # Seek to the appropriate index entry. |
paul@68 | 398 | |
paul@69 | 399 | self.position_index_iterator.seek(offset, doc_frequency) |
paul@68 | 400 | |
paul@69 | 401 | # Initialise the current index entry and current position file iterator. |
paul@44 | 402 | |
paul@44 | 403 | self._next_section() |
paul@44 | 404 | self._init_section() |
paul@44 | 405 | |
paul@44 | 406 | # Sequence methods. |
paul@44 | 407 | |
paul@44 | 408 | def __len__(self): |
paul@69 | 409 | return len(self.position_index_iterator) |
paul@44 | 410 | |
paul@44 | 411 | def sort(self): |
paul@44 | 412 | pass |
paul@44 | 413 | |
paul@44 | 414 | # Iterator methods. |
paul@44 | 415 | |
paul@44 | 416 | def __iter__(self): |
paul@44 | 417 | return self |
paul@44 | 418 | |
paul@44 | 419 | def next(self): |
paul@44 | 420 | |
paul@44 | 421 | """ |
paul@44 | 422 | Attempt to get the next document record from the section in the |
paul@44 | 423 | positions file. |
paul@44 | 424 | """ |
paul@44 | 425 | |
paul@44 | 426 | # Return any visited but unrequested record. |
paul@44 | 427 | |
paul@44 | 428 | if self.found_docnum is not None: |
paul@44 | 429 | t = self.found_docnum, self.found_positions |
paul@44 | 430 | self.found_docnum, self.found_positions = None, None |
paul@44 | 431 | return t |
paul@44 | 432 | |
paul@44 | 433 | # Or search for the next record. |
paul@44 | 434 | |
paul@44 | 435 | while 1: |
paul@44 | 436 | |
paul@44 | 437 | # Either return the next record. |
paul@44 | 438 | |
paul@44 | 439 | try: |
paul@69 | 440 | return self.position_iterator.next() |
paul@44 | 441 | |
paul@44 | 442 | # Or, where a section is finished, get the next section and try again. |
paul@44 | 443 | |
paul@44 | 444 | except StopIteration: |
paul@44 | 445 | |
paul@69 | 446 | # Although, where a single iterator is in use, the file reader |
paul@69 | 447 | # would be positioned appropriately, this is not guaranteed in a |
paul@69 | 448 | # multiple iterator situation. |
paul@44 | 449 | |
paul@44 | 450 | self._next_section() |
paul@69 | 451 | self._init_section() |
paul@44 | 452 | |
paul@44 | 453 | def from_document(self, docnum): |
paul@44 | 454 | |
paul@44 | 455 | """ |
paul@44 | 456 | Attempt to navigate to a positions entry for the given 'docnum', |
paul@44 | 457 | returning the positions for 'docnum', or None otherwise. |
paul@44 | 458 | """ |
paul@44 | 459 | |
paul@44 | 460 | # Return any unrequested document positions. |
paul@44 | 461 | |
paul@44 | 462 | if docnum == self.found_docnum: |
paul@44 | 463 | return self.found_positions |
paul@44 | 464 | |
paul@44 | 465 | # Read ahead in the index until the next entry refers to a document |
paul@44 | 466 | # later than the desired document. |
paul@44 | 467 | |
paul@44 | 468 | try: |
paul@44 | 469 | if self.next_docnum is None: |
paul@69 | 470 | self.next_docnum, self.next_pos_offset, self.next_section_count = self.position_index_iterator.next() |
paul@44 | 471 | |
paul@44 | 472 | # Read until the next entry is after the desired document number, |
paul@44 | 473 | # or until the end of the results. |
paul@44 | 474 | |
paul@44 | 475 | while self.next_docnum <= docnum: |
paul@44 | 476 | self._next_read_section() |
paul@44 | 477 | if self.docnum < docnum: |
paul@69 | 478 | self.next_docnum, self.next_pos_offset, self.next_section_count = self.position_index_iterator.next() |
paul@44 | 479 | else: |
paul@44 | 480 | break |
paul@44 | 481 | |
paul@44 | 482 | except StopIteration: |
paul@44 | 483 | pass |
paul@44 | 484 | |
paul@44 | 485 | # Navigate in the position file to the document. |
paul@44 | 486 | |
paul@44 | 487 | self._init_section() |
paul@44 | 488 | |
paul@44 | 489 | try: |
paul@44 | 490 | while 1: |
paul@69 | 491 | found_docnum, found_positions = self.position_iterator.next() |
paul@44 | 492 | |
paul@44 | 493 | # Return the desired document positions or None (retaining the |
paul@44 | 494 | # positions for the document immediately after). |
paul@44 | 495 | |
paul@44 | 496 | if docnum == found_docnum: |
paul@44 | 497 | return found_positions |
paul@44 | 498 | elif docnum < found_docnum: |
paul@44 | 499 | self.found_docnum, self.found_positions = found_docnum, found_positions |
paul@44 | 500 | return None |
paul@44 | 501 | |
paul@44 | 502 | except StopIteration: |
paul@44 | 503 | return None |
paul@44 | 504 | |
paul@44 | 505 | # Internal methods. |
paul@44 | 506 | |
paul@44 | 507 | def _next_section(self): |
paul@44 | 508 | |
paul@44 | 509 | "Attempt to get the next section in the index." |
paul@44 | 510 | |
paul@44 | 511 | if self.next_docnum is None: |
paul@69 | 512 | self.docnum, self.pos_offset, self.section_count = self.position_index_iterator.next() |
paul@44 | 513 | else: |
paul@44 | 514 | self._next_read_section() |
paul@44 | 515 | |
paul@44 | 516 | def _next_read_section(self): |
paul@44 | 517 | |
paul@44 | 518 | """ |
paul@44 | 519 | Make the next index entry the current one without reading from the |
paul@44 | 520 | index. |
paul@44 | 521 | """ |
paul@44 | 522 | |
paul@44 | 523 | self.docnum, self.pos_offset, self.section_count = self.next_docnum, self.next_pos_offset, self.next_section_count |
paul@44 | 524 | self.next_docnum, self.next_pos_offset, self.next_section_count = None, None, None |
paul@44 | 525 | |
paul@44 | 526 | def _init_section(self): |
paul@44 | 527 | |
paul@69 | 528 | "Initialise the iterator for the section in the position file." |
paul@47 | 529 | |
paul@68 | 530 | # Seek to the position entry. |
paul@47 | 531 | |
paul@69 | 532 | self.position_iterator.seek(self.pos_offset, self.section_count) |
paul@47 | 533 | |
paul@44 | 534 | # vim: tabstop=4 expandtab shiftwidth=4 |