Extension:Proofread Page
Proofread Page 拡張機能は以下のいずれかの方法で、ブックを作成する拡張機能です:
- 画像とOCR処理した文字欄とを並べる、もしくは
- 散文は段落ごと、詩文の場合は1句単位。文書の内容は MediaWiki のページの体裁 (参照読み込み) として。
目的は電子化した原稿と、画像処理により読み取った文字列を簡単に比較するためです。
元の文字列を複写せずに、いくつかの方法で表示します。[1]
使用法
この拡張機能はどのウィキソースのウィキにもインストールされます。 構文に関しては、ウィキソースの Proofread Page 解説文書 (校正機能) をご参照ください。 また Bibliowiki も導入していました。
要件と推奨事項
- ウェブブラウザ版から更新のスクリプト (maintenance/update.php) がうまく作動しない場合は、コマンドラインを利用する必要があります (アップグレードの解説文書 と Update.php 解説文書をご参照ください。)
- DjVu 形式のファイルを使用するには (必須ではありませんが推奨)、設定用にネイティブの DjVu ハンドラを用意してください。 Manual:How to use DjVu with MediaWiki も参照してください。
- 加えて、 ProofreadPage は以下の拡張機能と併用すると、かなり使用感が改善されます。
- LabeledSectionTransclusion (強く推奨)
- Cite (既定のページ フッターは
<references />
を含みます - Poem
- PdfHandler (追加的な PHP パッケージを必要とする場合があります) — PDF 対応を追加します
- PagedTiffHandler
- ParserFunctions
- TemplateStyles (索引に特化した CSS を有効にする)
- Scribunto (Lua ライブラリの校正を有効にする)
インストール
拡張機能
- ダウンロードして、ファイルを
extensions/
フォルダー内のProofreadPage
という名前のディレクトリ内に配置します。
開発者とコード寄稿者は、上記の代わりに以下を使用してGitからインストールします:cd extensions/
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/ProofreadPage - 以下のコードを LocalSettings.php ファイルの末尾に追加します:
wfLoadExtension( 'ProofreadPage' );
- 更新スクリプトを実行します。このスクリプトは、この拡張機能が必要とするデータベーステーブルを自動的に作成します。
- 完了 – ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。
サムネール作成
拡張機能は直接、画像のサムネイルにリンクしようとするものの、用意されていない場合がしばしばあります。 そこで リンク先不明の 404 エラーが出たら、必ずサムネール作成をしなければなりません。 その手順は、次のどれかひとつ を選んで実行します。
- Apache RewriteRule を .htaccess に設定し、未作成のサムネールを thumb.php する。
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^/w/images/thumb/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/page([0-9]+)-?([0-9]+)px-.*$ /w/thumb.php?f=$1&p=$2&w=$3 [L,QSA]
- もしくは Apache 404 ハンドラをウィキメディアの thumb-handler に設定。 これはメディアウィキ固有のコードを使う、一般用途の 404 ハンドラで、単なるサムネール作成器ではありません 。
ErrorDocument 404 /w/extensions/upload-scripts/404.php
- MediaWiki >= 1.20 対応は、単に thumb_handler.php にリダイレクト:
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^/w/images/thumb/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/page([0-9]+)-?([0-9]+)px-.*$ /w/thumb_handler.php [L,QSA]
- or in apache2.conf で:
ErrorDocument 404 /w/thumb_handler.php
If you encounter a problem similar to the following:
- phab:T301291 – PDF and DjVu files on Commons failed to be processed (no thumbnails, zero pages) but otherwise valid
- phab:T298417 – Undeleted DjVu files show incorrect metadata: 0x0 size, no page number info
- phab:T299521 – PDF file has 0x0 image size in Commons after uploading a new version while the page number is correct
Try next steps:
- repair thumbnails for DjVu files of the core MediaWiki (for PDF use mimetype
application/pdf
)php maintenance/refreshImageMetadata.php --verbose --mime image/vnd.djvu --force
- needed for actualization info about the pages counts of the
Special:IndexPages
php maintenance/refreshLinks.php --namespace 252
名前空間
ProofreadPage create by default two custom namespaces named "Page" and "Index" in English with respectively ids 250 and 252.
Their names are translated if your wiki use another language. 完全な一覧。
You can customize their name or their ID: Create namespaces by hand and set their IDs in Manual:LocalSettings.php using $wgProofreadPageNamespaceIds global. You will do something like:
define( 'NS_PROOFREAD_PAGE', 250);
define( 'NS_PROOFREAD_PAGE_TALK', 251);
define( 'NS_PROOFREAD_INDEX', 252);
define( 'NS_PROOFREAD_INDEX_TALK', 253);
$wgExtraNamespaces[NS_PROOFREAD_PAGE] = 'Page';
$wgExtraNamespaces[NS_PROOFREAD_PAGE_TALK] = 'Page_talk';
$wgExtraNamespaces[NS_PROOFREAD_INDEX] = 'Index';
$wgExtraNamespaces[NS_PROOFREAD_INDEX_TALK] = 'Index_talk';
$wgProofreadPageNamespaceIds = array(
'index' => NS_PROOFREAD_INDEX,
'page' => NS_PROOFREAD_PAGE
);
Namespace id customization is not recommended and might not be supported in the future.
設定
- ページ品質システム(page quality system)を稼働させるには、カテゴリ5件の作成が必須です。 当該のカテゴリの名称は MediaWiki:Proofreadpage_quality0_category から MediaWiki:Proofreadpage_quality4_category の定義が必須です。
- 必ず先に Extension:ParserFunctions をインストール
索引名前空間の設定
詳細は Extension:Proofread Page/Index data configuration をご参照ください
- 索引ページを表示するには MediaWiki:Proofreadpage_index_template を作成。 このページの実態はテンプレートであり、版のフォームからパラメータの項目を受け取ります。
- MediaWiki:Proofreadpage_index_data_config.json を作成して、索引フォームの設定を収納します。 この新規の設定ページは既存の MediaWiki:Proofreadpage_index_attributes と MediaWiki:Proofreadpage_js_attributes を上書き。
The configuration is a JSON array of properties. Here is the structure of a property in the array, all the parameters are optional, the default value are set:
{
"ID": { //id of the metadata (first parameter of proofreadpage_index_attributes)
"type": "string", //the property type (for compatibility reasons the values have not to be of this type). Possibles values: string, number, page. If set, the newly set values should be valid according to the type (e.g. for a number a valid number, for a page an existing wiki page...)
"size": 1, //only for the type string : number of lines of the input (third parameter of proofreadpage_index_attributes)
"values": {"a":"A", "b":"B","c":"C", "d":"D"}, //an array values : label that list the possible values (for compatibility reasons the stored values have not to be one of these)
"default": "", //the default value
"header": false, //add the property to MediaWiki:Proofreadpage_header_template template (true is equivalent to being listed in proofreadpage_js_attributes)
"label": "ID", //the label in the form (second parameter of proofreadpage_index_attributes)
"help": "", //a short help text
"delimiter": [], //list of delimiters between two part of values. By example ["; ", " and "] for strings like "J. M. Dent; E. P. Dutton and A. D. Robert"
"data": "" //proofreadpage's metadata type that the property is equivalent to
}
}
The data parameter can have for value:
"type", "language", "title", "author", "translator", "illustrator", "editor", "school", "year", "publisher", "place", "progress"
ページ区切り
The extension puts a separator between every transcluded page and the next, which is defined by wgProofreadPagePageSeparator
.
The default value is  
(a whitespace).
Set wgProofreadPagePageSeparator = ""
to suppress the separator.
Join hyphenated words across pages
When a word is hyphenated between a page and the next, the extension joins together the two halves of the word.
Example: his- and tory becomes history.
The "joiner" character is defined by wgProofreadPagePageJoiner
and defaults to '-' (the ASCII hyphen character).
Configure change tagging (optional)
See Change tagging to set up change tags.
使用法
最初のページを自作する (DjVu を採用した例)
- 以下の指示に従う前に、Manual:How to use DjVu with MediaWiki で述べた指示のとお理に処理したか確認しましょう。
- (DjVu ファイル自体のアップロード先はどの名前空間で時期はいつか?)
- "Page" 名前空間にページを作成 (もしくは非英語版ウィキを使う場合は国際化した名称のページが対象)。 一例としてもしも当該の名前空間が 'Page' なら
Page:Carroll - Alice's Adventures in Wonderland.djvu
を作成 - このページ commons:File:Carroll - Alice's Adventures in Wonderland.djvu に対応するファイルを作成 (もしくは Manual:$wgUseInstantCommons を
true
に設定)。 - 索引ページ
Index:Carroll - Alice's Adventures in Wonderland.djvu
を作成- ページ一覧を可視化するには Pages フィールドに
<pagelist />
タグを挿入
- ページ一覧を可視化するには Pages フィールドに
- 書籍の 5 ページ目を編集するには、'Page:Carroll - Alice's Adventures in Wonderland/5' に移動して編集をクリック
構文
この拡張機能が導入するタグは以下のとおりです:
<pages>
, <pagelist>
注記
- ↑ これらのページ群はメインの名前空間に置かれないため、テキスト単位の集計には反映されません。
関連項目
- 節
- Index data configuration
- Change tagging
- Lua library reference
- Page viewer
- Edit-in-Sequence — 新しいシステム (2022年時点) ではページ全体を再読み込みせずに校正が可能
- Roadmap of the development
- API
- Metadata API —
proofread
メタのサブモジュール - Proofread properties API — 個別のページにおける校正関連のプロパティ
- Index data API — 索引ページのデータを利用 (フィールドとカテゴリ)
- Index pagination API — 指定の索引にページをまとめる
- Metadata API —
- Manual:How to use DjVu with MediaWiki
- PdfHandler — Proofread Page に PDF 対応を追加
- 現状の説明の全文版と指示はこちら (英語版): s:Help:Proofread
- 利用統計の参照はこちら: https://wsstats.toolforge.org/
- コミュニティが提出した、やることリスト (ToDo) と機能の要望の一覧
- パブリックドメインの利用者マニュアルが公開されています。 Help:Extension:ProofreadPage
- MediaWiki:OCR.js - OCR スクリプト
この拡張機能は 1 つ以上のウィキメディアのプロジェクトで使用されています。 これはおそらく、この拡張機能が安定していて高いトラフィックのウェブサイトでも十分に動作することを意味します。 この拡張機能がインストールされている場所を確認するには、ウィキメディアの設定ファイル CommonSettings.php および InitialiseSettings.php 内で、この拡張機能の名前を探してください。 特定のウィキにインストールされている拡張機能の完全な一覧は、そのウィキの Special:Version ページにあります。 |
この拡張機能は以下のウィキ ファーム/ウィキ ホスト/パッケージに含まれています: これは正式な一覧ではありません。 一部のウィキ ファーム/ウィキ ホスト/パッケージは、ここに記載されていなくてもこの拡張機能を含んでいる場合があります。 必ずご利用のウィキ ファーム、ウィキ ホスト、バンドルで確認してください。 |