Text Copy Assistance Plugin for SAT

テキストコピー支援プラグイン for SAT(TCAPSAT)は、SAT大正新脩大藏經テキストデータベースからコピー&ペーストする際、不要な文字列を削除するなど、テキストを整形するPCブラウザ用のプラグイン(フリーウェア)です。これにより、文章執筆時の経典引用の負担を軽減します。
基本機能としては、半角スペース、アルファベット、数字、コロン及び「画像(IIIF)」という文字列、複数行に渡る連続した改行を削除します。またオプションとして、「偈頌の整形」「文節区切り」「異体文字の同定」を行うことができます。
PC版 Chrome 及び Microsoft Edgeに対応しています(Chromium系ブラウザで動作します)。

The "Text Copy Assistance Plugin for SAT(TCAPSAT)" is a chromium browser plug-in for PC that automatically removes unnecessary strings when copying and pasting from the SAT Taishō Shinshū Daizōkyō Text Database. This reduces the burden of quoting scriptures during writing.
As a basic feature, it removes half-width spaces, alphabets, numbers, colons, the string "画像", and consecutive line breaks spanning multiple lines.

Chromeウェブストアにアクセスして、インストールを選択してください。

◆ 設定方法

パズルアイコン( )からプラグインにアクセス(またはツールバーにピン留めされたTCAPSATのアイコンをクリック)し、「オン/オフ」のボタンで切り替えることで、一時的に停止させることができます。

The plugin functionality can be accessed from the puzzle icon ( ) or by clicking the pinned TCAPSAT icon in the toolbar. The "On/Off" button can be toggled to temporarily disable the functionality.

ユーザの好みにあわせて、様々なコピー方法を選択することができます。
拡張機能を使用するにはパズルアイコン( )からプラグインにアクセスします(またはツールバーにピン留めされたTCAPSATのアイコン)。

Users can choose from a variety of copy methods to suit their preferences.
The plugin functionality can be accessed from the puzzle icon ( ) or by clicking the pinned TCAPSAT icon in the toolbar.

"句点を取り除く" 機能を使うことで、文中の「」を取り除くことができます。

Enabling the "Remove Periods" mode removes periods () from the text.

"改行を取り除く" 機能を使うことで、文中の改行を取り除くことができます。

Enabling the "Remove Newlines" mode removes newlines from the text.

注意(Note):

全ての改行が取り除かれる点にご注意ください。
"Sentence Breaks" 機能と併用することをおすすめします。

Please note that all newlines will be removed.
It is recommended to use this in combination with the "Sentence Breaks" mode.

"文節区切り" 機能では、文節の区切りに改行を加えます。
"改行を取り除く" 機能と併用することで不要な改行を削除しつつ、文節に改行を加えることができます。

The "Sentence Breaks" mode inserts line breaks at sentence boundaries.
By using it in conjunction with the "Remove Newlines" mode, unnecessary line breaks are removed while adding breaks at sentence boundaries.

注意(Note):

大正新脩大藏經は、通常1行あたり16~17文字で構成されていますが、いくつかの例外があります。
例えば、次のようなケースです。
(1) 句点の数によって、1行が16文字未満になる場合
(2) Unicodeに存在しない文字のため、画像として提供されている場合。

そこで、この機能では「1行が14文字以下(画像、句点を除く)の場合」を文節とみなし、改行を加えます。
※15~17文字の場合、文節と見なす機能は使用できません(v1.1.8beta以降では、12~15文字に調節可能です)。
また、最初の1文字目が全角スペースの場合、その行に改行を加えます(v1.1.1以降)。
多くの場合、この設定で解決できますが、例外がある場合には手動で改行の操作を行ってください。

The Taishō Shinshū Daizōkyō (The Taisho Tripitaka) is generally composed of lines with about 16 to 17 characters. However, there are some exceptions. For example:
(1) The number of periods results in a line being fewer than 16 characters.
(2) Characters not present in Unicode are provided as images.

Therefore, this feature treats lines with 14 characters or fewer (excluding periods and images) as sentence breaks and adds line breaks.
(No line breaks are added for lines with 15 to 17 characters.)
Additionally, if the first character is a full-width space, a line break will be added to that line (from version 1.01.01 onward).
In most cases, this setting will work, but if there are exceptions, please adjust the line breaks manually.

"偈頌の整形" 機能では、偈頌部分の空白を取り除き、一文字繰り下げてコピーすることができます。
"改行を取り除く"と併用した場合にも、偈頌部分の改行はそのまま残します。

The "Remove Spaces on Verse" mode removes spaces before and after verses and shifts the text by one character for copying.
When used in conjunction with the "Remove Newlines" mode, line breaks in the verse sections remain intact

例(Example):

テキスト処理前
Text data before processing.
テキスト整形後
Text data after processing.
時梵童子以偈報曰
〇〇〇〇典尊汝所修爲欲何志求〇〇〇〇
〇〇〇〇今設此供養當爲汝受之
又告大典尊。汝若有所問自恣問之。當爲
時梵童子以偈報曰
典尊汝所修爲欲何志求
今設此供養當爲汝受之
又告大典尊。汝若有所問自恣問之。當爲
"〇" represents a full-width space.

注意(Note):

一部の偈頌には非対応です。行の初めに連続した4文字の全角スペースがない場合、「偈頌」として認識されません。

Some verses are not supported. This feature will not recognize a line as a verse if there are not four consecutive full-width spaces at the beginning of the line.

"異体文字同定" 機能では、多くの旧字体(異体字)を「新字体」に変換することができます。
対応する文字データは「CharacterMap.json」ファイルに含まれており、テキストエディタで簡単に追記可能です。
(v1.1.8beta以降では、登録エディタを用意しています。)

The "Convert Characters" mode converts many old-style (and variant) characters to "new-style characters".
Character data is included in the "CharacterMap.json" file, and additional entries can be added.

例(Example):

テキスト処理前
Text data before processing.
テキスト整形後
Text data after processing.
依三。悉順行。略説如前。地大大神。除疑惑。依三。悉順行。略説如前。地大大神。除疑惑。
Red text represents the characters to be converted.

異体字の追記方法(Format for "CharacterMap.json")

Description:

(1) 1行目は{を入力します。
(2) 異体字が1つの場合には、コードサンプル2行目のように入力します。
(3) 次の行に異体文字を続けて入力する場合には、カンマ(,)を追加します。
(4) 異体字が複数の場合には、コードサンプル3行目のように入力します。
(5) 異体字の最終行にはカンマをつけません。
(6) 最後の行は}を入力します。

(1) Must be included "{" on the first line.
(2) In case there is only one variant character, input it as shown on the second line on Code sample.
(3) If continuing on the next line, add a comma (,).
(4) In case there are multiple variant characters, input them as shown on the third line on Code sample.
(5) Do not include a comma on the last character line.
(6) Must be included "}"on the last line.

Code sample:

{
"断": ["斷"],
"帰": ["歸", "皈"],
"宝": ["寶", "寳", "珤", "寚"]
}

文字コードはUTF-8を使用します(ファイル保存時)。

Point:

記述方式が正しいか確かめるには、JSONLintを使うと便利です。
To verify if the format is correct, using JSONLint is helpful.

本プラグインを使用して不具合が発生した場合、また適切に文字列を処理できなかった場合でも、当サイトは責任を負いません。

This plug-in is not responsible for any issues that may arise from using this plugin, nor for any failure to properly process strings.

当サイトはリンクフリーです。
ただし、当サイトのコンテンツを複写・複製することは固く禁止致します。
トップページ: https://sosesha.com/
プラグイン配布ページ: https://sosesha.com/sat_plugin

You are more than welcome to post my website URL on other websites.
However, copying or reproducing any content of the website is strictly prohibited.
Top page: https://sosesha.com/
Plugin distribution page: https://sosesha.com/sat_plugin