はじめに
wicket は Wikipedia XML ダンプファイルからプレーンテキストを抽出する高性能ツールです。並列処理と効率的なストリーミングにより高速な処理を実現しています。
主な機能
- ストリーミング XML パース – メモリに全体を読み込まず、数十 GB のダンプに対応
- 並列テキスト抽出 – rayon による複数 CPU コアの活用
- bzip2 自動展開 –
.xml.bz2ダンプファイルの透過的な展開 - 2種類の出力フォーマット – doc フォーマットおよび JSON フォーマット
- ファイル分割 – 出力ファイルの最大サイズを指定可能
- 名前空間フィルタリング – 特定のページ種別のみ抽出(メイン記事、トークページなど)
出力フォーマット
doc フォーマット(デフォルト)
<doc id="1" url="https://en.wikipedia.org/wiki/April" title="April">
April is the fourth month of the year...
</doc>
JSON フォーマット
{"id":"1","url":"https://en.wikipedia.org/wiki/April","title":"April","text":"April is the fourth month of the year..."}
現在のバージョン
wicket v0.1.0 – Rust Edition 2024、最小 Rust バージョン 1.85。