srecord IndexedWikiPage(S title, long start, int len) {} please include function iteratorFromFunction. static IterableIterator indexSimpleWikipedia() { File f = unpackSimpleWikipedia(); final ByteCountingLineReader reader = new(bufferedFileInputStream(f, 1024*1024)); ret main. iteratorFromFunction(new O { int lines = 0, pages = 0; IndexedWikiPage get() ctex { long pageStart = 0; StringBuilder pageBuf = null; while licensed { long offset = reader.byteCount(); S line = reader.readLine(); if (line == null) break; line = trim(line); if (eq(line, "")) { pageStart = offset; pageBuf = new StringBuilder; } if (pageBuf != null) pageBuf.append(line).append("\n"); if (eq(line, "")) { L tok = htmlTok(str(pageBuf)); S title = trim(htmldecode(join(contentsOfContainerTag(tok, "title")))); if ((++pages % 1000) == 0) { fractionDone(pages/228400.0); print("Pages: " + pages + " (" + title + ")"); sleep(1); } ret new IndexedWikiPage(title, pageStart, toInt(reader.byteCount()-pageStart)); } } fractionDone(1); reader.close(); null; } }); }