Extension:Proofread Page

This page is a translated version of the page Extension:Proofread Page and the translation is 75% complete.
MediaWiki 拡張機能マニュアル
Proofread Page
リリースの状態: 安定
実装 ページの操作 , ContentHandler , タグ , API , データベース
説明 The Proofread Page extension can render a book either as a column of OCR text beside a column of scanned images, or broken into its logical organization (such as chapters or poems) using transclusion.
作者 ThomasV (original author)
Tpt (current maintainer)
最新バージョン continuous updates
互換性の方針 MediaWiki とともにリリースされるスナップショット。 master には後方互換性がありません。
MediaWiki current master
PHP 7.0+
データベースの変更 はい
Composer mediawiki/proofread-page
テーブル pr_index
ライセンス GNU 一般公衆利用許諾書 2.0 以降
ダウンロード
ヘルプ Help:Extension:ProofreadPage
s:Index:Wind in the Willows (1913).djvu
Page, Index
  • $wgProofreadPagePageJoiner
  • $wgProofreadPagePageSeparator
  • $wgProofreadPageNamespaceIds
  • $wgProofreadPageEnableEditInSequence
  • $wgProofreadPageBookNamespaces
  • $wgProofreadPageUseStatusChangeTags
  • $wgProofreadPagePageSeparatorPlaceholder

  • pagequality
  • pagequality-admin
  • pagequality-validate
translatewiki.net で翻訳を利用できる場合は、Proofread Page 拡張機能の翻訳にご協力ください
問題点 未解決のタスク · バグを報告

Proofread Page extension

2020 Coolest Tool
Award Winner

in the category
Impact


Proofread Page 拡張機能は以下のいずれかの方法で、ブックを作成する拡張機能です:

  1. 画像とOCR処理した文字欄とを並べる、もしくは
  2. 散文は段落ごと、詩文の場合は1句単位。文書の内容は MediaWiki のページの体裁 (参照読み込み) として。

目的は電子化した原稿と、画像処理により読み取った文字列を簡単に比較するためです。

元の文字列を複写せずに、いくつかの方法で表示します。[1]

使用法

この拡張機能はどのウィキソースのウィキにもインストールされます。 構文に関しては、ウィキソースの Proofread Page 解説文書 (校正機能) をご参照ください。 また Bibliowiki も導入していました。

要件と推奨事項


インストール

拡張機能

  • ダウンロードして、ファイルを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
  警告: There is an .htaccess file in the images directory that may interfere with any .htaccess rules you install.

If you encounter a problem similar to the following:

  • phab:T301291PDF and DjVu files on Commons failed to be processed (no thumbnails, zero pages) but otherwise valid
  • phab:T298417Undeleted DjVu files show incorrect metadata: 0x0 size, no page number info
  • phab:T299521PDF file has 0x0 image size in Commons after uploading a new version while the page number is correct

Try next steps:

  1. 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
    
  2. 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.

設定

索引名前空間の設定

詳細は Extension:Proofread Page/Index data configuration をご参照ください

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 /> タグを挿入
  • 書籍の 5 ページ目を編集するには、'Page:Carroll - Alice's Adventures in Wonderland/5' に移動して編集をクリック

構文

この拡張機能が導入するタグは以下のとおりです: ‎<pages>, ‎<pagelist>

注記

  1. これらのページ群はメインの名前空間に置かれないため、テキスト単位の集計には反映されません。

関連項目