1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-12-07 17:28:05 +00:00

[ja_JP] Japanese translation update - 'Filters' section of tiddlywiki.com (#9067)

* [ja-JP] Japanese translation of 'editions\tw5.com\tiddlers\concepts\Filters.tid'

* [ja-JP] Japanese translation of 'editions\tw5.com\tiddlers\concepts\Filters.tid'

* [ja-JP] Japanese translation of 'editions\tw5.com\tiddlers\filters\syntax\Filter Syntax.tid'

* [ja-JP] Japanese translation of 'editions\tw5.com\tiddlers\filters\syntax\Filter Expression.tid'

* [ja-JP] Japanese translation of 'editions\tw5.com\tiddlers\filters\syntax\Filter Run.tid'

* [ja-JP] Japanese translation of 'editions\tw5.com\tiddlers\filters\syntax\Filter Step.tid'

* [ja-JP] Japanese translation of 'editions\tw5.com\tiddlers\concepts\Selection Constructors.tid'

* [ja-JP] Japanese translation of 'editions\tw5.com\tiddlers\filters\syntax\Filter Parameter.tid'

* [ja-JP] Japanese translation of 'editions\tw5.com\tiddlers\filters\syntax\Filter Run Prefix.tid'

* [ja-JP] Japanese translation of 'editions\tw5.com\tiddlers\filters\syntax\Interchangeable Filter Run Prefixes.tid'

* [ja-JP] Japanese translation of 'editions\tw5.com\tiddlers\filters\syntax\Named Filter Run Prefix.tid'

* [ja-JP] Japanese translation of 'editions\tw5.com\tiddlers\filters\syntax\All Filter Run Prefix.tid'

* [ja-JP] Japanese translation of 'editions\tw5.com\tiddlers\filters\syntax\And Filter Run Prefix.tid'

* [ja-JP] Japanese translation of 'editions\tw5.com\tiddlers\filters\syntax\Cascade Filter Run Prefix.tid'

* [ja-JP] Japanese translation of 'editions\tw5.com\tiddlers\filters\syntax\Cascade Filter Run Prefix (Examples).tid'

* [ja-JP] Japanese translation of 'editions\tw5.com\tiddlers\filters\syntax\Else Filter Run Prefix.tid'

* [ja-JP] Japanese translation of 'editions\tw5.com\tiddlers\filters\syntax\Except Filter Run Prefix.tid'

* [ja-JP] Japanese translation of 'editions\tw5.com\tiddlers\filters\syntax\Filter Filter Run Prefix.tid'

* [ja-JP] Japanese translation of 'editions\tw5.com\tiddlers\filters\syntax\Filter Filter Run Prefix (Examples).tid'

* [ja-JP] Japanese translation of 'editions\tw5.com\tiddlers\filters\syntax\Intersection Filter Run Prefix.tid'

* [ja-JP] Japanese translation of 'editions\tw5.com\tiddlers\filters\syntax\Intersection Filter Run Prefix (Examples).tid'

* [ja-JP] Japanese translation of 'editions\tw5.com\tiddlers\filters\syntax\Map Filter Run Prefix.tid'

* [ja-JP] Japanese translation of 'editions\tw5.com\tiddlers\filters\syntax\Map Filter Run Prefix (Examples).tid'

* [ja-JP] Japanese translation of 'editions\tw5.com\tiddlers\filters\syntax\Or Filter Run Prefix.tid'

* [ja-JP] Japanese translation of 'editions\tw5.com\tiddlers\filters\syntax\All Filter Run Prefix.tid'

* [ja-JP] Japanese translation of 'editions\tw5.com\tiddlers\filters\syntax\Reduce Filter Run Prefix.tid'

* [ja-JP] Japanese translation of 'editions\tw5.com\tiddlers\filters\syntax\Reduce Filter Run Prefix (Examples).tid'

* [ja-JP] Japanese translation of 'editions\tw5.com\tiddlers\filters\syntax\Sort Filter Run Prefix.tid'

* [ja-JP] Japanese translation of 'editions\tw5.com\tiddlers\filters\syntax\Sort Filter Run Prefix (Examples).tid'

* [ja-JP] Japanese translation of 'editions\tw5.com\tiddlers\filters\syntax\then Filter Run Prefix.tid'

* [ja-JP] Japanese translation of 'editions\tw5.com\tiddlers\filters\syntax\Then Filter Run Prefix (Examples).tid'

* [ja-JP] Japanese translation of 'editions\tw5.com\tiddlers\filters\syntax\Shortcut Filter Run Prefixes.tid'

* [ja-JP] Japanese translation of 'editions\tw5.com\tiddlers\filters\syntax\Interchangeable Filter Run Prefixes.tid'

* [ja-JP] Japanese translation of 'editions\tw5.com\tiddlers\filters\syntax\Filter Whitespace.tid'
This commit is contained in:
IchijikuIchigo
2025-06-04 01:28:55 +09:00
committed by GitHub
parent 0b5ed7893f
commit c117bfd2c5
31 changed files with 1022 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
created: 20130827080000000
list: [[Introduction to filter notation]] [[Filter Syntax]]
modified: 20250218103107943
original-modified: 20230710074511095
tags: Reference Concepts TableOfContents
title: Filters
ja-title: フィルタ
type: text/vnd.tiddlywiki
\define openAdvancedSearch()
<$action-setfield $tiddler="$:/state/tab--1498284803" text="$:/core/ui/AdvancedSearch/Filter"/>
<$action-setfield $tiddler="$:/temp/advancedsearch/input" text="[tag[Filters]]"/>
<$action-setfield $tiddler="$:/temp/advancedsearch" text="[tag[Filters]]"/>
\end
TiddlyWikiは、レコードがTiddlerであるデータベースと考えることができます。データベースは通常、どのレコードが特定のパターンに一致するかを発見する方法を提供します。~TiddlyWikiでは、これはフィルタを使用して行われます
<<.def フィルタ>>は、その<<.def "アウトプット">>として特定の[[Tiddlerセット|Title Selection]]を選択するための簡潔な表記法です。~TiddlyWikiはフィルタに遭遇するたびにアウトプットを計算します。その後、それらのTiddlerを使って、[[数を数え|CountWidget]]たり、[[リストし|ListWidget]]たりするなど、さらなる処理を行うことができます
次の例では、フィルタを<<.mlink list-links>>マクロに渡します。<<.olink2 tag tag>> <<.word フィルタ>>であるTiddlerのリストを表示します:
<<wikitext-example-without-html """<<list-links "[tag[Filters]]">>""" >>
Wiki内でTiddlerが追加や削除されると、フィルタのアウトプットが変更される可能性があります。~TiddlyWikiは即再計算し、フィルタベースのカウントやリストも自動的に更新します
''さらに詳細:''
* <$linkcatcher message="tm-navigate" actions=<<openAdvancedSearch>> >[[高度な検索|$:/AdvancedSearch]]</$linkcatcher> -- フィルタを簡単に試すことができる<<.advancedsearch-tab Filter>>タブがあります
* [[WikiTextでのフィルタされたトランスクルージョン|Transclusion in WikiText]] -- テキスト内でフィルタ結果を使用したい場合

View File

@@ -0,0 +1,19 @@
created: 20150117204109000
modified: 20250222112113766
original-modified: 20240708201746542
tags: Filters
title: Selection Constructors
ja-title: セレクションコンストラクタ
type: text/vnd.tiddlywiki
[[フィルタステップ|Filter Step]]のアウトプットはその[[オペレータ|Filter Operators]]によって異なります:
* ほとんどのオペレータは、インプットからアウトプットを派生します。たとえば、それらの多くはインプットのサブセットをアウトプットし、まさに<<.word フィルタ>>の名にふさわしく、含んでいる[[ラン|Filter Run]]の全体的なアウトプットを絞り込みます。これらのオペレータは<<.def "セレクションモディファイア">>と呼ばれます。
* いくつかのオペレータはインプットを無視し、代わりに独立したアウトプットを生成します。これらは<<.def "セレクションコンストラクタ">>と呼ばれ、完全に新しい[[セレクション|Title Selection]]を構築します。
コンストラクタの良い例は<<.olink title>>です。`[title[A]title[B]]`のアウトプットは<<.tid B>>です。しかし、<<.olink field>>オペレータはモディファイアなので、`[title[A]field:title[B]`は何もアウトプットしません。
次の[[フィルタオペレータ|filter Operator]]は<<tag>>でタグ付けされています:
<<list-links "[tag<currentTiddler>]" class:"multi-columns">>

View File

@@ -0,0 +1,20 @@
created: 20230316150731234
from-version: 5.1.23
modified: 20250303102704427
original-modified: 20230711084644541
rp-input: 前回のフィルタランからのすべてのタイトル
rp-output: アウトプットタイトルは、重複を排除せずに以前のフィルタランの出力に追加されます。
rp-purpose: 重複を排除しない和集合
tags: [[Named Filter Run Prefix]]
title: All Filter Run Prefix
ja-title: allフィルタランプレフィックス
type: text/vnd.tiddlywiki
<$railroad text="""
\start none
\end none
( ":all" | - )
[["ラン"|"Filter Run"]]
"""/>
このプレフィックスにはオプションの[[ショートカット構文|Shortcut Filter Run Prefix]]であるシンボル`=run`があります

View File

@@ -0,0 +1,20 @@
created: 20230318142752854
from-version: 5.1.23
modified: 20250303103244036
original-modified: 20230711084712170
rp-purpose: フィルタステップの蓄積
rp-input: これまでのすべてのランのフィルタアウトプット
rp-output: アウトプットのタイトルは、以前のフィルターランのアウトプットを置換
tags: [[Named Filter Run Prefix]]
title: And Filter Run Prefix
ja-title: andフィルタランプレフィックス
type: text/vnd.tiddlywiki
<$railroad text="""
\start none
\end none
( ":and" | - )
[["ラン"|"Filter Run"]]
"""/>
このプレフィックスにはオプションの[[ショートカット構文|Shortcut Filter Run Prefix]]であるシンボル+runがあります

View File

@@ -0,0 +1,48 @@
created: 20211130114857532
filter1: [prefix[ca]then[ca]]
filter2: [suffix[at]then[at]]
filter3: other
modified: 20250310110107153
original-modified: 20230305125250563
tags: [[Cascade Filter Run Prefix]]
title: Cascade Filter Run Prefix (Examples)
ja-title: cascadeフィルタランプレフィックス (例)
type: text/vnd.tiddlywiki
<<.op ":cascade">>フィルタランプレフィックスは、タグマクロによって生成されるタグピルで使用される各Tiddlerの配色を選択するために、~TiddlyWikiコアによって使用されます。
`:cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]]`
上記の<<.op :cascade>>フィルタラン内のフィルタ式は、<<tag $:/tags/TiddlerColourFilter>>でタグ付けされたTiddlerのテキストフィールドからフィルタのリストを返します。以下を参照:
<ul>
<$list filter="[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]]">
<li><pre><$text text=<<currentTiddler>>/></pre></li>
</$list>
</ul>
インプットタイトルごとに、これらのフィルタが順番に適用され、空でないリストを返す最初のフィルタが見つかるまで続きます。この空でないリストの最初の結果がそのインプットタイトルに置き換えられ、そのTiddlerの色として使用されます。
<<.operator-example 1 """[all[shadows+tiddlers]] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]] +[!is[blank]limit[10]]""">>
!! 拡張例
この例では、<<.op :cascade>>フィルタランがどのように機能するかを段階的に説明します。
アウトプットがフィルタのリストを返すフィルタ式が必要です。通常、このようなフィルタ式は、一連のTiddler内のいくつかのフィールドを照会して(おそらくタグ経由で)フィルタのリストを作成します。この例を自己完結型にするために、このTiddlerの//filter1//、//filter2//、//filter3//フィールドに、3つのフィルタが格納されます。[[テキスト参照|TextReference]]と[[appendオペレータ|append Operator]]のインスタンスを使用して、フィールドをフィルタのリストに結合します。
フィルター`[{!!filter1}append{!!filter2}append{!!filter3}]`は、次のフィルタリストを生成します:
<ul>
<$list filter="[{!!filter1}append{!!filter2}append{!!filter3}]">
<li><pre><$text text=<<currentTiddler>>/></pre></li>
</$list>
</ul>
この例では、`cat can bat bug`がインプットタイトルとして使用されます。各インプットタイトルは、上記の各フィルタに対して順番に<<.op :cascade>>で評価されます。<<.op :cascade>>の内部で何が起こっているかを理解しやすくするために、次の表では、[[mapフィルタランプレフィックス|Map Filter Run Prefix]]を使用して、各フィルタの結果を示しています。
|^<<.operator-example c1.1 "cat can bat bug :map[prefix[ca]then[ca]]">>|^<<.operator-example c1.2 "cat can bat bug :map[suffix[at]then[at]]">>|^<<.operator-example c1.3 "cat can bat bug :map[[other]]">>|
上記の3つの例で"Try it"をクリックします。<<.op :cascade>>を使用すると、各行の左から右に読み取られた最初の空白以外の値が返されます。最終結果を確認するには、下の"Try it"をクリックします。
<<.operator-example c1.4 "cat can bat bug :cascade[{!!filter1}append{!!filter2}append{!!filter3}]">>

View File

@@ -0,0 +1,27 @@
created: 20211130114043280
from-version: 5.2.1
modified: 20250305112707026
original-modified: 20230710073343947
rp-input: これまでのすべてのランのフィルタアウトプット
rp-output: このフィルタランによって返されるフィルタによって変更されたインプットタイトル
rp-purpose: フィルターのリストを順に評価し、最初の結果を適用してインプットタイトルを変更
tags: [[Named Filter Run Prefix]]
title: Cascade Filter Run Prefix
ja-title: cascadeフィルタランプレフィックス
type: text/vnd.tiddlywiki
<$railroad text="""
\start none
\end none
( ":cascade" | - )
[["ラン"|"Filter Run"]]
"""/>
この[[フィルタラン|Filter Run]]の[[フィルタ式|Filter Expression]]が評価され、フィルタのリストが返されます。次に、各インプットタイトルが各フィルタに対して順番に評価され、インプットタイトルは空でないリストを返す最初のフィルタの最初の結果に置き換えられます。どのフィルタもインプットタイトルの結果を返さない場合は、空の文字列に置き換えられます。
フィルタラン内では、次の変数を使用できます:
* <<.var currentTiddler>> - インプットタイトル
* <<.var ..currentTiddler>> - フィルタラン外の変数<<.var currentTiddler>>の値。
[[cascadeフィルタランプレフィックス (例)|Cascade Filter Run Prefix (Examples)]]

View File

@@ -0,0 +1,22 @@
created: 20230318142408662
from-version: 5.1.23
modified: 20250312102737003
original-modified: 20230322140756821
rp-input: 前のフィルタランからのすべてのタイトル
rp-output: これまでのフィルタアウトプットが空のリストの場合、ランのアウトプットタイトルがフィルタアウトプットに[[追加|Dominant Append]]されます<br>これまでのフィルタアウトプットが空のリストでない場合、ランは無視されます
rp-purpose: フィルタランは、これまでのすべてのランのフィルタアウトプットが空のリストである場合にのみ評価されます
tags: [[Named Filter Run Prefix]]
title: Else Filter Run Prefix
ja-title: elseフィルタランプレフィックス
type: text/vnd.tiddlywiki
<$railroad text="""
\start none
\end none
( ":else" | - )
[[run|"Filter Run"]]
"""/>
このプレフィックスには[[ショートカットフィルタランプレフィックス|Shortcut Filter Run Prefix]] シンボル`~run`があります
参照: [[thenフィルタランプレフィックス|Then Filter Run Prefix]] | [[thenオペレータ|then Operator]] と [[elseオペレータ|else Operator]]

View File

@@ -0,0 +1,20 @@
created: 20230318142056008
from-version: 5.1.23
modified: 20250312104032308
original-modified: 20230322140643066
rp-input: 前のフィルタランからのすべてのタイトル
rp-output: アウトプットタイトルはフィルタのアウトプットから取り除かれますそのようなTiddlerが存在する場合
rp-purpose: このフィルタランのアウトプットタイトルが前のフィルタランのアウトプットに含まれている場合は取り除かれ、含まれていない場合は無視されます
tags: [[Named Filter Run Prefix]]
title: Except Filter Run Prefix
ja-title: exceptフィルタランプレフィックス
type: text/vnd.tiddlywiki
<$railroad text="""
\start none
\end none
( ":except" | - )
[[run|"Filter Run"]]
"""/>
このプレフィックスには[[ショートカットフィルタランプレフィックス|Shortcut Filter Run Prefix]]シンボル`-run`があります

View File

@@ -0,0 +1,23 @@
created: 20150124182421000
modified: 20250219114110986
original-modified: 20230710074507466
tags: [[Filter Syntax]]
title: Filter Expression
ja-title: フィルタ式
type: text/vnd.tiddlywiki
<<.def "フィルタ式">>は、[[フィルタのシンタックス|Filter Syntax]]の最も外側のレベルです。これは、[[フィルタランプレフィックス|Filter Run Prefix]]を備えた [[フィルタラン|Filter Run]]で構成されます。複数のフィルタ実行は[[ホワイトスペース|Filter Whitespace]]で区切られます。
<$railroad text="""
{ (
- |
: [[<"プレフィックス">|"Filter Run Prefix"]]
)
[["ラン"|"Filter Run"]]
+ [["ホワイトスペース"|"Filter Whitespace"]]
}
"""/>
<<.tip """上に示したように、図に開始線と終了線が1つある場合は、リンクされた上位レベルにさらに情報があることを意味します。パンくずリストはナビゲーションに使用できます""">>
<<.tip """下位レベルで使用されているように、図に開始点と終了点がない場合は、読みやすさと単純さを高めるために、上位レベルのシンタックス要素が削除されていることを意味します。パンくずリストはナビゲーションに使用できます""">>

View File

@@ -0,0 +1,33 @@
created: 20211129022707404
modified: 20250314105437481
original-modified: 20230305125338118
tags: [[Filter Filter Run Prefix]]
title: Filter Filter Run Prefix (Examples)
ja-title: filterフィルタランプレフィックス(例)
type: text/vnd.tiddlywiki
<<.operator-example 1 "[tag[HelloThere]] :filter[get[text]length[]compare:integer:gteq[1000]]">>
<<.operator-example 2 "[tag[HelloThere]] :filter[get[text]length[]compare:integer:lteq[2000]]">>
<<.operator-example 3 "[tag[HelloThere]] :filter[get[text]length[]compare:integer:gteq[1000]] :filter[get[text]length[]compare:integer:lteq[2000]]">>
<<.operator-example 4 "[tag[Features]] :filter[links[]!is[shadow]is[missing]]">>
<<.operator-example 5 "A B C D E F :filter[<index>remainder[2]compare:integer:eq[0]]" "インプットリストの要素を1つおきに返す">>
<<.operator-example 6 "[tag[shopping]] :filter[{!!quantity}compare:integer:gt[4]] :map[addprefix[ ]addprefix{!!quantity}]">>
<<.operator-example 7 "[tag[shopping]] :filter[{!!quantity}compare:integer:lteq[4]] :map[addprefix[ ]addprefix{!!quantity}]">>
!! フィルタランプレフィックス`:filter`と`:and`/`+`の比較
<<.op :filter>>フィルタランプレフィックスの機能は、<<.op :and>>プレフィックス(エイリアス<<.op +>>)と一部重複しています。上記のフィルタ式にはすべて、次の2 つのプロパティがあることに注意してください:
# フィルタ式の先頭では、インプットタイトル(つまり、`get[text]length[]`、`links[]`、`<index>remainder[2]`、`{!!quantity}`)が変換されます。
# フィルタ式の最後では、インプット項目が何らかの条件(つまり`compare`、`is`)を満たす場合にのみアウトプットに送信されます。
<<.op :filter>>プレフィックスの目的はプロパティ#1によってインプットタイトルが変換されるにもかかわらず、元のインプットタイトルを返すことです。こうすることで、"何らかの条件を満たす"チェックを元のインプット以外のものに対して実行できます。一部のフィルタ式でプロパティ#1が必要ない場合は、代わりに<<.op :and>>プレフィックスを使用できます。
| <<.op :filter>> | <<.op :and>> |
|^<<.operator-example c1.1 "[tag[HelloThere]] :filter[get[text]length[]compare:integer:gteq[1000]]">>|^<<.operator-example c1.2 "[tag[HelloThere]] :and[get[text]length[]compare:integer:gteq[1000]]">>|
|^<<.operator-example c2.1 "[tag[Features]] :filter[links[]!is[shadow]is[missing]]">>|^<<.operator-example c2.2 "[tag[Features]] :and[links[]!is[shadow]is[missing]]">>|
|!結果は同じ|<|
|^<<.operator-example c3.1 "cat can bat bug :filter[suffix[at]minlength[3]]">>|^<<.operator-example c3.2 "cat can bat bug :and[suffix[at]minlength[3]]">>|

View File

@@ -0,0 +1,34 @@
created: 20211129022455873
from-version: 5.1.23
modified: 20250314105047035
original-modified: 20230710073334078
rp-input: これまでのすべてのランのフィルタアウトプット
rp-output: フィルタランが空でないインプットタイトル
rp-purpose: フィルタランアウトプットが空のリストであるすべてのインプットタイトルを除外
tags: [[Named Filter Run Prefix]]
title: Filter Filter Run Prefix
ja-title: filterフィルタランプレフィックス
type: text/vnd.tiddlywiki
<$railroad text="""
\start none
\end none
( ":filter" | - )
[["ラン"|"Filter Run"]]
"""/>
これまでのフィルタアウトプットをインプットとして受け取ります。次のランはインプットの各タイトルに対して評価され、アウトプットが空のリストであるすべてのインプットタイトルが除かれます。
フィルタラン内では、<<.var currentTiddler>>変数は処理中のTiddlerのタイトルに設定されていることに注意してください。これにより、`:filter[{!!price}multiply{!!cost}compare:integer:gteq[5]]`のようなフィルタランを計算に使用できるようになります。ラン外のcurrentTiddlerの値は、<<.var ..currentTiddler>>変数で使用できます。
フィルターラン内では、次の変数を使用できます:
* <<.var currentTiddler>> - インプットタイトル
* <<.var ..currentTiddler>> - フィルタラン外の変数`currentTiddler`の値。
* <<.var index>> - <<.from-version "5.2.1">> 現在のリスト項目の数値インデックス(リストの最初の項目はゼロです)。
* <<.var revIndex>> - <<.from-version "5.2.1">> 現在のリスト項目の逆数値インデックス(リストの最後の項目はゼロです)。
* <<.var length>> - <<.from-version "5.2.1">> インプットリストの長さの合計。
<<.tip "名前付きフィルタランプレフィックス`:filter`を、この演算子は、すべてのインプットタイトルにサブフィルタを適用し、サブフィルタから空の結果を返すタイトルを除外する[[filterオペレータ|filter Operator]]と比べてください。">>
[[filterフィルタランプレフィックス(例)|Filter Filter Run Prefix (Examples)]]

View File

@@ -0,0 +1,40 @@
created: 20150220152540000
modified: 20250223102930110
original-modified: 20240708202234843
tags: [[Filter Step]]
title: Filter Parameter
ja-title: フィルタパラメータ
type: text/vnd.tiddlywiki
<$railroad text="""
\start none
\end none
( "[" [: <-"ハード"-> /"]以外"/] "]"
|
"{" [: <-"間接"-> /"}以外"/] "}"
|
"<" [: <-"変数"-> /">以外"/] ">"
)
"""/>
[[フィルタオペレータ|Filter Operators]]のパラメーターは次のようになります:
;<<.def ハード>>
: `[パラメータ例]`
: パラメータは、角括弧内のテキストそのものです。
;<<.def ソフト>>
: <<.def 間接>>
:: `{パラメータ例}`
:: パラメータは、中括弧内の名前の[[テキスト参照|TextReference]]によって示されるテキスト、つまり、指定されたTiddlerの[[フィールド|TiddlerFields]]、または指定された[[データTiddler|DataTiddlers]]のプロパティの値です。
: <<.def 変数>>
:: `<パラメータ例>`
:: パラメータは、山括弧内の[[変数|Variables]]の現在値です。マクロパラメータは、v5.2.0まではサポートされて<<.em いません>>。
::<<.from-version "5.2.0">> リテラルマクロパラメータがサポートされています。例: `[<now [UTC]YYYY0MM0DD0hh0mm0ssXXX>]`。
<<.note """すべての[[フィルタオペレータ|filter Operator]]の後にはパラメータ式が続く必要があります。[[パラメータの無いオペレータ|Operators without parameters]]の場合、その式は空になります(`[<currentTiddler>links[]]`のフィルタオペレータ<<.olink links>>と同様)。""">>
---
<<.from-version "5.1.23">> [[フィルタステップ|Filter Step]]では、`,`文字で区切られた複数のパラメータがサポートされます。
例えば: `[param1],[param2]`や`<param1>,{param2}`

View File

@@ -0,0 +1,21 @@
created: 20230305130600148
modified: 20250223105142349
original-modified: 20230711090913687
tags: [[Filter Expression]]
title: Filter Run Prefix
ja-title: フィルタランプレフィックス
type: text/vnd.tiddlywiki
There are 2 types of filter run prefixes that are interchangeable; [[named prefixes|Named Filter Run Prefix]] and [[shortcut prefixes|Shortcut Filter Run Prefix]].
交換可能なフィルタランプレフィックスには、[[名前付きプレフィックス|Named Filter Run Prefix]]と[[ショートカットプレフィックス|Shortcut Filter Run Prefix]]の2種類があります。
<$railroad text="""
\start none
\end none
(
- |
: [[<":名前付きプレフィクス"> /"v5.1.23以降"/ |"Named Filter Run Prefix"]] |
[[<"ショートカットプレフィックス"> /"v5.1.23以前"/ |"Shortcut Filter Run Prefix"]]
)
[[<"ラン">|"Filter Run"]]
"""/>

View File

@@ -0,0 +1,29 @@
created: 20150124182117000
modified: 20250220111652831
original-modified: 20230710074357002
tags: [[Filter Expression]]
title: Filter Run
ja-title: フィルタラン
type: text/vnd.tiddlywiki
<$railroad text="""
\start none
\end none
( "[" { [[<"フィルタステップ">|"Filter Step"]] } "]"
|
[:{/"[ ]または空白以外の文字"/}]
|
'"' [:{/'"以外の文字'/}] '"'
|
"'" [:{/"'以外の文字"/}] "'"
)
"""/>
<<.def ラン>>は[[ステップ|Filter Step]]で構成され、より大きな[[フィルタ式|Filter Expression]]に貢献する[[選択|Title Selection]]を出力します。
ステップは左から右に処理されます。最初のステップへのインプットはランへのインプットと同じです。後続の各ステップのインプットは、前のステップのアウトプットです。
図の下の3つのオプションは`HelloThere`、`"HelloThere"`、`'HelloThere'`と`"Filter Operators"`の構文と一致します。これらは`[title[...]]`の短縮形です。
引用符で囲まれたオプションは、`"An [[[[Unusual]]]] Tiddler"`のように角括弧を含むタイトルをサポートするために存在します。

View File

@@ -0,0 +1,37 @@
created: 20150124182127000
modified: 20250222110925130
original-modified: 20230710074414361
tags: [[Filter Run]]
title: Filter Step
ja-title: フィルタステップ
type: text/vnd.tiddlywiki
<<.def "フィルタステップ">>は、<<.def "フィルタラン">>内の単一の操作を表します。
プログラミング用語では、ステップのインプットがパラメータとして渡される関数呼び出しに似ています。ステップのアウトプットは、[[フィルタラン|Filter Run]]、つまりそれを含む[[フィルタ式|Filter Expression]]全体に貢献する[[タイトルセレクション|Title Selection]]です。
<$railroad text="""
\start none
\end none
[:"!"]
( / "省略の場合のデフォルト: title" /|:
( - | :[[<"オペレータ">|"Filter Operators"]] )
{ [:":" [[<"サフィックス">|"Filter Operators"]] ] } )
{ [[<"パラメータ">|"Filter Parameter"]] + "," }
"""/>
ステップの<<.def オペレータ>>は、[[フィルタオペレータ|Filter Operators]]として知られている定義済みキーワードのリストです。
多くのステップでは、ステップの実行内容をさらに定義する明示的な<<.def パラメータ>>が必要です。
<<.def サフィックス>>は、特定のオペレータの意味を拡張する追加テキスト(多くの場合、[[フィールド|TiddlerFields]]名)です。
ステップの<<.def オペレータ>>と<<.def サフィックス>>がすべて省略されている場合は、デフォルトで[[title|title Operator]]オペレータが使用されます。
<<.from-version "5.1.23">> いくつかのステップでは、`,`文字で区切られた複数の<<.def パラメータ>>を受け入れます。
認識されないオペレータは、<<.olink field>>オペレータのサフィックスであるかのように扱われます。
フィルタオペレータはプラグインによって拡張できます。
{{Selection Constructors}}

View File

@@ -0,0 +1,26 @@
created: 20140210141217955
list: [[Filter Expression]] [[Filter Run]] [[Filter Step]] [[Filter Parameter]] [[Filter Whitespace]]
modified: 20250219112710650
original-modified: 20230710074340943
tags: Filters
title: Filter Syntax
ja-title: フィルタのシンタックス
type: text/vnd.tiddlywiki
<<.preamble """[[フィルタ|Filters]]は、正式な構文の説明が役立つと思われる人向けに、[[Railroadダイアグラム|Railroad Diagrams]]を使用して示されている文法に従います。ただし、このグループのTiddlerを理解していなくても、[[フィルタの書き方を学ぶ|Introduction to filter notation]]ことができます""">>
<<.def フィルタ>>は、<<.def インプット>>を<<.def アウトプット>>に変換するためのパイプラインです。インプットとアウトプットはどちらも、Tiddlerとフィールドの[[タイトルの順序付き集合|Title Selection]]です
フィルタは、''ラン''と呼ばれる小さな構成要素から構成される''式''であり、''ラン''は''ステップ''を使用して構築されます。それぞれがインプットをアウトプットに変換します
フィルタは空のアウトプットから始まります。その実行は左から右に処理され、アウトプットが徐々に修正されます。
"フィルタのシンタックス"の記述は次で始まります:
<$railroad text="""
\start double
\end double
[[<"フィルタ式">|"Filter Expression"]]
"""/>
<<.tip "上記のようなRailroadボックスを使用して移動できます。">>

View File

@@ -0,0 +1,15 @@
created: 20150124182304000
modified: 20250510104756224
original-modified: 20230710074447240
tags: [[Filter Expression]]
title: Filter Whitespace
ja-title: フィルタホワイトスペース
type: text/vnd.tiddlywiki
<$railroad text="""
\start none
\end none
{( "スペース" | "タブ" | "ラインフィード" | "リターン" | "垂直タブ" | "改ページ" )}
"""/>
[[フィルタ式|Filter Expression]]の各ランの間にはホワイトスペース文字が出現します。

View File

@@ -0,0 +1,47 @@
created: 20230316151518640
modified: 20250225113139787
original-modified: 20230327130626715
tags: [[Filter Run Prefix]]
title: Interchangeable Filter Run Prefixes
ja-title: 交換可能なフィルターランプレフィックス
type: text/vnd.tiddlywiki
!! 交換可能なフィルターランプレフィックス
技術的/論理的な用語で言えば:
|!ラン |!同等の名前付きプレフィックス |!解釈 |!アウトプット |
|`[run]` |`:or[run]` |重複を排除した和集合 |... OR ラン |
|`+[run]` |`:and[run]` |フィルタステップの蓄積 |... AND ラン |
|`-[run]` |`:except[run]` |差集合 |... AND NOT ラン |
|`~[run]` |`:else[run]` |それ以外 |... ELSE ラン |
|`=[run]` |`:all[run]` |重複を排除しない和集合 |... OR ラン |
ランのインプットは通常、Wiki内の[[隠し|ShadowTiddlers]]Tiddler以外のすべてのTiddlerタイトルのリストです(順不同)。<br>ただし、`+`プレフィックスによってこれを変更できます:
|プレフィックス|インプット|h
|`-`, `~`, `=`, `:intersection` あるいは、無し| 最初の[[フィルタオペレータ|Filter Operators]]によって特に指定されない限り、<$link to="all Operator">`[all[]]`</$link> Tiddlerのタイトル|
|`+`, `:filter`, `:map`, `:reduce`,`:sort` |これまでのすべてのランのフィルタアウトプット|
インプットが変化するため、`-`と`+`の両方のプレフィックスが互いに逆の動作をしないことに注意してください。
たとえば、次の2つの例では、`$:/baz`は実際に存在する場合にのみ削除されます:
* <$link to="is Operator"> `foo bar $:/baz -[is[system]]`</$link>
* <$link to="prefix Operator">`foo bar $:/baz -[prefix[$:/]]`</$link>
理由を理解するには、両方の最後のランのインプットとその`-`プレフィックスを考慮してください。
存在するかどうかに関係なく、`$:/baz`を削除するには、[[否定のフィルタオペレータ|Filter Operators]]とともに`+`プレフィックスを使用するだけです:
* <$link to="is Operator">`foo bar $:/baz +[!is[system]]`</$link>
* <$link to="prefix Operator">`foo bar $:/baz +[!prefix[$:/]]`</$link>
!! +と和集合の違い
`+`と`:intersection`の違いについては[[和集合フィルタランプレフィックス(例)|Intersection Filter Run Prefix (Examples)]]を参照してください。
!! 開発者向け
新しいフィルタランプレフィックスを作成するには、`filterrunprefix`の[[モジュールタイプ|ModuleType]]で
[[Javascriptモジュール|Modules]]を作成します。

View File

@@ -0,0 +1,38 @@
created: 20211128212902292
modified: 20250319104544220
original-modified: 20230305125354209
tags: [[Intersection Filter Run Prefix]]
title: Intersection Filter Run Prefix (Examples)
ja-title: intersectionフィルタランプレフィックス(例)
type: text/vnd.tiddlywiki
<<.operator-example 1 "A B C D :intersection[enlist[C D E F]]">>
<<.operator-example 2 "A B C D :intersection[enlist[A B C D]]">>
<<.operator-example 3 "A B C D :intersection[enlist[E F G H]]">>
<<.operator-example 4 ":intersection[enlist[A B C D]]" "最初のフィルタランでintersectionを使用することはあまり役に立ちません。結果は常に空になります。">>
!! `+`と`:intersection`の違い
プレフィックス`+`は、形式論理における"AND"として考えてください。たとえば、"条件A ''かつ'' 条件Bを満たすすべてのタイトルを取得する"などです。ただし、すべてのケースに適しているわけではありません。条件Bがインプットを置き換えるフィルタオペレータを使用する場合、プレフィックス`+`の使用は難しくなります。たとえば、2つのTiddlerに共通するタグを見つけたい場合は、次のようなフィルタ式を記述します:
* <$link to="tags Operator">`[[field Operator]tags[]] +[[compare Operator]tags[]]`</$link>
しかし、これは機能しません。2回目のフィルタランでインプットが破棄され、単一のtitle`[[compare Operator]]`で構成されるインプットに置き換えられるからです。そのため、このフィルタ式から得られる結果は、`compare Operator`Tiddlerのタグだけになります。
このような場合、必要なのは`:intersection`プレフィックスです。これまでのフィルタアウトプットを取得して、//保留し//、すべてのTiddlerタイトルをインプットとして次のフィルタランを開始します。その後、最新のフィルタランが完了すると、最新のアウトプットを取得して保留していたアウトプットと比較し、保留していたアウトプットと最新のアウトプットの両方に表示されたタイトルのみを含む新しいアウトプットを生成します。したがって、`field Operator`と`compare Operator`に共通するタグのみを取得するには、次のようなフィルタ式を記述します。
* <$link to="tags Operator">`[[field Operator]tags[]] :intersection[[compare Operator]tags[]]`</$link>
次の例では、[[field Operator]]と[[compare Operator]]を使用して、Tiddlerとそれぞれのタグを比較します。
<<.operator-example 5 "[[field Operator]tags[]]">>
<<.operator-example 6 "[[compare Operator]tags[]]">>
<<.operator-example 7 "[[field Operator]tags[]] +[[compare Operator]tags[]]" """"field Operator"Tiddlerのタグは失われるため、"compare Operator"Tiddlerのタグのみが返されます""">>
<<.operator-example 8 "[[field Operator]tags[]] :intersection[[compare Operator]tags[]]" """両方のTiddlerに共通するタグを返します""">>

View File

@@ -0,0 +1,22 @@
created: 20211128212902292
from-version: 5.1.23
modified: 20250317105829721
original-modified: 20230710073322863
rp-input: 前のフィルタランからのすべてのタイトル
rp-output: このフィルタランの結果と前のランのアウトプットの両方に存在するタイトル
rp-purpose: 前のランからのタイトルとこのフィルタのタイトルの共通部分を見つける
tags: [[Named Filter Run Prefix]]
title: Intersection Filter Run Prefix
ja-title: intersectionフィルタランプレフィックス
type: text/vnd.tiddlywiki
<$railroad text="""
\start none
\end none
( ":intersection" | - )
[["ラン"|"Filter Run"]]
"""/>
前のランからのフィルタアウトプットは保留されます。`:intersection`フィルタランは、すべてのTiddlerタイトルをインプットとして開始されます。この最後のフィルタランが完了すると、最後のアウトプットが保留アウトプットと比較されます。保留アウトプットと最新アウトプットの両方に表われるタイトルのみを含む新しいアウトプットが生成されます。
[[intersectionフィルタランプレフィックス(例)|Intersection Filter Run Prefix (Examples)]]

View File

@@ -0,0 +1,60 @@
created: 20210618134753828
modified: 20250416110748088
original-modified: 20230305125405422
tags: [[Map Filter Run Prefix]]
title: Map Filter Run Prefix (Examples)
ja-title: mapフィルタランプレフィックス(例)
type: text/vnd.tiddlywiki
インプットタイトルが存在する場合はキャプションフィールドで置き換え、存在しない場合はインプットタイトルを保持します:
<<.operator-example 1 "[tag[Widgets]] :map[get[caption]else{!!title}]">>
<<.tip "上記の例は`[tag[Widgets]] :map[{!!caption}!is[blank]else{!!title}]`と同等です。フィールドを`{!!caption}`のようにテキスト参照として参照する場合、存在しない、または空のキャプションフィールドに対しては空文字列が返されることに注意してください。したがって、`else`オペレータの前に`is[blank]`のチェックが必要です。">>
買い物リストの各タイトルについて、各アイテムの購入にかかる合計コストを計算します:
<<.operator-example 2 "[tag[shopping]] :map[get[quantity]else[0]multiply{!!price}]">>
`Widget:`でタグ付けされたすべてのTiddlerのタグを取得します:
<<.operator-example 3 "[tag[Widgets]] :map:flat[tagging[]] :and[!is[blank]unique[]]">>
<<.tip "`flat`サフィックスがない場合、`:map`フィルタランは各インプットタイトルの最初の結果のみを返します">>
!! `:map`の`flat`サフィックスの有無の比較
`:map`フィルタランは、少なくともインプットと同じ数のアウトプットを返します。デフォルトでは、1つのインプット項目に対して1つのアウトプット項目が生成されます。フィルタランによってインプット項目が空の結果に変換された場合、その項目のアウトプットは空の文字列になります。フィルタランによってインプット項目が複数の項目に変換された場合、アウトプットには最初の項目のみが表われます。この動作は、`flat`サフィックスを指定することで上書きできます。`flat`サフィックスを指定すると、すべての項目がアウトプットに表れます。
| `:map` | `:map:flat` |
|^<<.operator-example m0.1 "[range[4]] :map[match[this matches nothing]]">>|^<<.operator-example m0.2 "[range[4]] :map:flat[match[this matches nothing]]">>|
|^<<.operator-example m1.1 "[range[4]] :map[range<currentTiddler>]">>|^<<.operator-example m1.2 "[range[4]] :map:flat[range<currentTiddler>]">>|
|^<<.operator-example m2.1 "[range[4]] :map[range<currentTiddler>]">>|^<<.operator-example m2.2 "[range[4]] :map:flat[range<currentTiddler>first[]]">>|
|^<<.operator-example m3.1 "[range[4]] :map[range<currentTiddler>sum[]]">>|^<<.operator-example m3.2 "[range[4]] :map:flat[range<currentTiddler>sum[]]">>|
|^<<.operator-example m4.1 "[[1,2,3]] [[4,5]] :map[split[,]]">>|^<<.operator-example m4.2 "[[1,2,3]] [[4,5]] :map:flat[split[,]]">>|
|^<<.operator-example m5.1 "[[1,2,3]] [[4,5]] :map[split[,]]">>|^<<.operator-example m5.2 "[[1,2,3]] [[4,5]] :map:flat[split[,]first[]]">>|
!! `:map`と`:and`/`+`フィルタランプレフィックスの比較
`:map`フィルタランプレフィックスの機能は、`:and` プレフィックス(別名`+`)と一部重複しています。これらは同じ結果を返す場合もありますが、少なくとも以下の場合には結果が異なります:
# `:and`フィルタランによってアイテム数が変更される(増加や減少)場合があります。`:map`フィルタランによってアイテム数が変更されることはありません。
# `:and`フィルタランのアイテム数は、[[重複排除|Dominant Append]]により減少します。`:map`ランは[[重複排除|Dominant Append]]は行われません。
# "currentTiddler"変数への明示的な参照は異なる動作をします
# TextReferenceを使用した"currentTiddler"への暗黙的な参照は異なる動作をします。
| `:map` | `:and` |
|!結果は同じ|<|
|^<<.operator-example 1.1 "[range[5]] :map[add[1]]">>|^<<.operator-example 1.2 "[range[5]] :and[add[1]]">>|
|^<<.operator-example 2.1 "[range[5]] :map[addsuffix[ hello]]">>|^<<.operator-example 2.2 "[range[5]] :and[addsuffix[ hello]]">>|
|^<<.operator-example 3.1 "[tag[shopping]] :map[get[quantity]]">>|^<<.operator-example 3.2 "[tag[shopping]] :and[get[quantity]]">>|
|!項目数が減少|<|
|^<<.operator-example 4.1 "[range[5]] :map[sum[]]">>|^<<.operator-example 4.2 "[range[5]] :and[sum[]]">>|
|^<<.operator-example 5.1 "[range[5]] :map[join[,]]">>|^<<.operator-example 5.2 "[range[5]] :and[join[,]]">>|
|!項目数が増加|<|
|^<<.operator-example 6.1 "[[1,2,3]] [[4,5]] :map[split[,]]">>|^<<.operator-example 6.2 "[[1,2,3]] [[4,5]] :and[split[,]]">>|
|!重複排除|<|
|^<<.operator-example 7.1 "[range[5]] :map[[hello]]">>|^<<.operator-example 7.2 "[range[5]] :and[[hello]]">>|
|!currentTiddler|<|
|^<<.operator-example 8.1 "[tag[shopping]] :map[<currentTiddler>]">>|^<<.operator-example 8.2 "[tag[shopping]] :and[<currentTiddler>]">>|
|^<<.operator-example 9.1 "[tag[shopping]] :map[{!!quantity}]">>|^<<.operator-example 9.2 "[tag[shopping]] :and[{!!quantity}]">>|

View File

@@ -0,0 +1,35 @@
created: 20210618133745003
from-version: 5.2.0
modified: 20250319105451115
original-modified: 20240312202834547
rp-input: 前回までのすべてのランのフィルタアウトプット
rp-output: このフィルタランの結果によって変更されたインプットタイトル
rp-purpose: 各項目に対してこのフィルタを実行した結果に基づいてインプットタイトルを変更
rp-suffix: <<.from-version "5.2.3">> フィルタランからすべての結果を返す場合は<<.value flat>>、最初の結果のみを返す場合は省略(デフォルト)
tags: [[Named Filter Run Prefix]]
title: Map Filter Run Prefix
ja-title: mapフィルタランプレフィックス
type: text/vnd.tiddlywiki
<$railroad text="""
\start none
\end none
( ":map" (: ":flat" | - ) | - )
[["ラン"|"Filter Run"]]
"""/>
以前のランからの各インプットタイトルは、順番にこのランに渡されます。フィルタランはインプットタイトルを変換し、このランのアウトプットはインプットタイトルを置き換えます。たとえば、フィルタラン`[get[caption]else{!!title}]`は、タイトルが保持されるフィールドが存在しない場合以外、各インプットタイトルをそのキャプションフィールドに置き換えます。
フィルタラン内では、<<.var currentTiddler>>変数は処理中のTiddlerのタイトルに設定されていることに注意してください。これにより、`:map[{!!price}multiply{!!cost}]`のようなフィルタランが計算に使用できるようになります。
フィルタラン内では、次の変数を使用できます:
* <<.var currentTiddler>> - インプットタイトル
* <<.var ..currentTiddler>> - フィルタランの外での変数`currentTiddler`の値。
* <<.var index>> - <<.from-version "5.2.1">> 現在のリスト項目の数値インデックス(リストの最初の項目はゼロ)。
* <<.var revIndex>> - <<.from-version "5.2.1">> 現在のリスト項目の逆数値インデックス(リストの最後の項目はゼロ)。
* <<.var length>> - <<.from-version "5.2.1">> インプットリストの合計の長さ。
`:map`プレフィックス付きで使用されるフィルタランは、渡された項目と少なくとも同じ数の項目を返す必要があります。フィルタランがアウトプットを返さないインプットタイトルは、空の文字列に置き換えられます。特に、[[getオペレータ|get Operator]]を使用してフィールドの値を取得する場合は、[[elseオペレータ|else Operator]] を使用してフィールド値が欠落しないようにすると役立ちます。たとえば、`[get[myfield]else[default-value]...`のようにします。
[[mapフィルタランプレフィックス(例)|Map Filter Run Prefix (Examples)]]

View File

@@ -0,0 +1,38 @@
created: 20201214044413473
modified: 20250227102948619
original-modified: 20230711090833212
tags: [[Filter Run Prefix]]
title: Named Filter Run Prefix
ja-title: 名前付きフィルタランプレフィックス
type: text/vnd.tiddlywiki
<<.from-version "5.1.23">>で、名前付きフィルタランプレフィックスが実装されました。図に示すように、`:cascade`、`:map`、`:sort`が後から追加されました。
名前付きフィルタランプレフィックスは、[[ショートカットランプレフィックス|Shortcut Filter Run Prefix]]の代わりに、[[フィルタ式|Filter Expression]]の[[ラン|Filter Run]]の前に置くことができます。
<$railroad text="""
\start none
\end none
(
[[<":all"> |"All Filter Run Prefix"]] |
[[<":and"> |"And Filter Run Prefix"]] |
[[<":cascade"> /"v5.2.1"/ |"Cascade Filter Run Prefix"]] |
[[<":else"> |"Else Filter Run Prefix"]] |
[[<":except"> |"Except Filter Run Prefix"]] |
[[<":filter"> |"Filter Filter Run Prefix"]] |
[[<":intersection"> |"Intersection Filter Run Prefix"]] |
[[<":map"> /"v5.2.0"/ |"Map Filter Run Prefix"]] |
[[<":or"> |"Or Filter Run Prefix"]] |
[[<":reduce"> |"Reduce Filter Run Prefix"]] |
[[<":sort"> /"v5.2.0"/ |"Sort Filter Run Prefix"]] |
[[<":then"> /"v5.3.0"/ |"Then Filter Run Prefix"]]) [[run|"Filter Run"]]
"""/>
<<.tip "名前付きフィルタランプレフィックス`:filter`を、すべてのインプットタイトルにサブフィルタを適用し、サブフィルタから空の結果を返すタイトルを除外する[[filterオペレータ|filter Operator]]と比較します">>
<<.tip "名前付きフィルタランプレフィックス`:reduce`を、サブフィルタを繰り返し適用してアイテムのリストを単一のアイテムに平坦化するために使用される[[reduceオペレータ|reduce Operator]]と比較します">>
<<.tip """フィルタランプレフィックス`:reduce`、`:sort`、`:map`、`:filter`内では、変数<<.var currentTiddler>>は処理中のTiddlerのタイトルに設定されます。<br>サブフィルタ外のcurrentTiddlerの値は、変数<<.var "..currentTiddler">>で使用できます <<.from-version "5.2.0">>""" >>
参照: [[交換可能なフィルターランプレフィックス|Interchangeable Filter Run Prefixes]]

View File

@@ -0,0 +1,20 @@
created: 20230318135743766
from-version: 5.1.23
modified: 20250417105150020
original-modified: 20230322140708372
rp-input: 前回のフィルタランからのすべてのタイトル
rp-output: アウトプットタイトルは主に、前回のフィルタランのアウトプットに[[重複排除して追加|Dominant Append]]されます。
rp-purpose: Tiddlerセットの重複排除した結合
tags: [[Named Filter Run Prefix]]
title: Or Filter Run Prefix
ja-title: orフィルタランプレフィックス
type: text/vnd.tiddlywiki
<$railroad text="""
\start none
\end none
( ":or" | - )
[["ラン"|"Filter Run Prefix"]]
"""/>
:or プレフィックスはプレフィックスを全く使用しないのと同じです。[[フィルタランプレフィックスのショートカット|Shortcut Filter Run Prefix]]で`run`を参照してください

View File

@@ -0,0 +1,29 @@
created: 20211124151912931
modified: 20250419111355942
original-modified: 20230305125430544
tags: [[Reduce Filter Run Prefix]]
title: Reduce Filter Run Prefix (Examples)
ja-title: reduceフィルタランプレフィックス(例)
type: text/vnd.tiddlywiki
\define multiply-input() [multiply<accumulator>]
次の例では、これらのデータTiddlerを使用します:
<ul>
<$list filter="[tag[shopping]!has[draft.of]]">
<li>
''<$link><$text text=<<currentTiddler>>/></$link>'' quantity: <$text text={{!!quantity}}/>, price: <$text text={{!!price}}/>
</li>
</$list>
</ul>
<<.operator-example 1 "[tag[shopping]] :reduce[get[quantity]add<accumulator>]">>
<<.operator-example 2 "[tag[shopping]] :reduce[get[price]multiply{!!quantity}add<accumulator>]">>
<<.operator-example 3 "[tag[shopping]] :reduce[<index>compare:number:gt[0]then<accumulator>addsuffix[, ]addsuffix<currentTiddler>else<currentTiddler>]" "最初の項目に対して他の項目とは異なる動作をさせるために`<index>`を使用します。これはあくまでもデモンストレーションです。このタスクを実行するには、[[joinオペレータ|join Operator]]を使うのがよいです">>
<<.operator-example 4 "[tag[non-existent]] :reduce[get[price]multiply{!!quantity}add<accumulator>]" "空のインプットは空のアウトプットを生成します">>
<<.operator-example 5 "[tag[non-existent]] :reduce[get[price]multiply{!!quantity}add<accumulator>] :else[[0]]" "インプットが空の場合に確実にアウトプットするために`:else`使用します">>
<$macrocall $name=".tip" _="""[[reduceオペレータ|reduce Operator]]とは異なり、`:reduce`プレフィックスはaccumulatorの初期値を指定できないため、初期値は常に空(数学オペレータでは0として扱われます)になります。したがって`=1 =2 =3 :reduce[multiply<accumulator>]`は、6ではなく0が生成されます。accumulatorの初期値を指定する必要がある場合は、[[reduceオペレータ|reduce Operator]]を使用します。"""/>
<<.operator-example 6 "=1 =2 =3 :reduce[multiply<accumulator>]" "空の初期値は数学オペレータによって0として扱われます">>
<<.operator-example 7 "=1 =2 =3 +[reduce<multiply-input>,[1]]" "正しい結果を得るためには初期値の設定が必要な場合があります">>

View File

@@ -0,0 +1,49 @@
created: 20211124151912931
from-version: 5.1.23
modified: 20250417105804821
original-modified: 20230710073305239
rp-input: 前回のフィルタランからのすべてのフィルタアウトプット
rp-output: 累積された単一アイテム
rp-purpose: 各インプットタイトルにフィルタランを繰り返し適用して、前回までのすべてのフィルタアウトプットを単一の項目に置き換え
tags: [[Named Filter Run Prefix]]
title: Reduce Filter Run Prefix
ja-title: reduceフィルタランプレフィックス
type: text/vnd.tiddlywiki
<$railroad text="""
\start none
\end none
( ":reduce" | - )
[["ラン"|"Filter Run"]]
"""/>
前回のランからの各インプットタイトルは、順番にこのランに渡されます。このランへの以前の呼び出しの結果は、変数<<.var accumulator>>を介して次の呼び出しで使用できます。このランへの最後の呼び出しの結果がアウトプットとして返されます。典型的な使用法は、各インプットタイトルの特定のフィールドの値を合計することです。
上記のように、数式を各インプットタイトルに繰り返し適用して、これまでのすべてのフィルタアウトプットを1つの項目に置き換えます。
フィルタラン内では、次の変数を使用できます:
* <<.var accumulator>> - 前回のフィルタランの結果
* <<.var currentTiddler>> - インプットタイトル
* <<.var ..currentTiddler>> - フィルタラン外での変数`currentTiddler`の値。 <<.from-version "5.2.0">>
* <<.var index>> - 現在のリスト項目の数値インデックス(リストの最初の項目は0)
* <<.var revIndex>> - 現在のリスト項目の逆の数値インデックス(リストの最後の項目は0)
* <<.var length>> - インプットリストの長さの合計
<<.tip "名前付きフィルタランプレフィックス`:reduce`を、サブフィルタを繰り返し適用して項目リストを1つの項目に平坦化するために使用される[[reduceオペレータ|reduce Operator]]`:reduce`と比べてください。">>
```
[tag[shopping]] :reduce[get[quantity]add<accumulator>]
```
は以下と同等です:
```
\define num-items() [get[quantity]add<accumulator>]
[tag[shopping]reduce<num-items>]
```
[[reduceフィルタランプレフィックス(例)|Reduce Filter Run Prefix (Examples)]]

View File

@@ -0,0 +1,30 @@
created: 20230305131705188
modified: 20250510102220175
original-modified: 20230710074438655
tags: [[Filter Run Prefix]]
title: Shortcut Filter Run Prefix
ja-title: ショートカットフィルタランプレフィックス
type: text/vnd.tiddlywiki
ショートカットのプレフィックスはタイピングが速いため、上級ユーザーによく使用されますが、経験の浅いユーザーには読みにくいという欠点があります。そのため、より詳細な情報を持つ[[名前付きプレフィックス|Named Filter Run Prefix]]が作成されました。ショートカットと名前付きフィルタランプレフィックスは、以下の表に示すように互換性があります。
<$railroad text="""
\start none
\end none
(-|:"+"|"-"|"~"|"=")
[["ラン"|"Filter Run"]]
"""/>
ランに次の内容が含まれている場合:
* プレフィックスが無い場合、アウトプットタイトルはフィルタのアウトプットに[[優先的に追加|Dominant Append]]されます
* プレフィックス`+`は、前回までのフィルタアウトプットをインプットとして受け取り、そのアウトプットはこれまでのすべてのフィルタアウトプットを<<.em "置き換え">>、次のランのインプットを形成します
* プレフィックス`-`は、アウトプットタイトルがフィルタのアウトプットから<<.em 取り除か>>れます(そのようなTiddlerが存在する場合)
* プレフィックス`~`は、フィルタアウトプットが空リストの場合、ランの結果のタイトルがフィルタアウトプットに[[優先的に追加|Dominant Append]]されます。フィルタアウトプットが空リストでない場合、ランは無視されます。<<.from-version "5.1.18">>
* プレフィックス`=`は、アウトプットタイトルが重複排除されずにフィルタのアウトプットに追加されます。<<.from-version "5.1.20">>
{{Interchangeable Filter Run Prefixes}}

View File

@@ -0,0 +1,35 @@
created: 20210428074912172
modified: 20250420104606860
original-modified: 20230315165343329
tags: [[Sort Filter Run Prefix]]
title: Sort Filter Run Prefix (Examples)
ja-title: sortフィルタランプレフィックス(例)
type: text/vnd.tiddlywiki
タイトルの長さで並べ替え:
<<.operator-example 1 "[all[tiddlers]] :sort:number[length[]] +[limit[10]]">>
タイトルの長さを逆順に並べ替え:
<<.operator-example 2 "[all[tiddlers]] :sort:number:reverse[length[]] +[limit[10]]">>
テキストの長さで並べ替え:
<<.operator-example 3 "[all[tiddlers]] :sort:number[get[text]length[]] +[limit[10]]">>
修正日の新しい順に並べ替え:
<<.operator-example 4 "[tag[Field Operators]] :sort:date[get[modified]else[19700101]] +[limit[10]]">>
タイトルで並べ替え:
<<.operator-example 5 "[tag[Field Operators]] :sort:string:casesensitive[get[caption]] +[limit[10]]">>
タイトルの逆順に並べ替え:
<<.operator-example 6 "[tag[Field Operators]] :sort:string:casesensitive,reverse[get[caption]] +[limit[10]]">>
大文字と小文字を区別してテキストとして並べ替え:
<<.operator-example 7 "Apple Banana Orange Grapefruit guava DragonFruit Kiwi apple orange :sort:string:casesensitive[{!!title}]">>
大文字と小文字を区別せずにテキストとして並べ替え:
<<.operator-example 8 "Apple Banana Orange Grapefruit guava DragonFruit Kiwi apple orange :sort:string:caseinsensitive[{!!title}]">>

View File

@@ -0,0 +1,61 @@
created: 20210428083929749
from-version: 5.2.0
modified: 20250419111702297
original-modified: 20240717120111427
rp-input: 前回までのすべてのランのフィルタアウトプット
rp-output: アウトプットタイトルは、以前のフィルタランのアウトプットを置き換え
rp-purpose: 各項目に対して実行されたこのフィルタの評価結果によってインプットタイトルを並べ替え
rp-suffix: :sortフィルタランプレフィックスはリッチサフィックスを使用します。詳細については以下を参照
rp-suffix-name: S
tags: [[Named Filter Run Prefix]]
title: Sort Filter Run Prefix
ja-title: sortフィルタランプレフィックス
type: text/vnd.tiddlywiki
<$railroad text="""
\start none
\end none
( ":sort" )
( ":" )
( : "string" | "alphanumeric" | "number" | "integer" | "version" | "date" )
( ":" )
{
(
(
( : "caseinsensitive" /"stringとalphanumericには必須"/ | "casesensitive" /"stringとalphanumericには必須"/)
| "reverse" /"オプション"/
)
)
+","
}
[["ラン"|"Filter Run"]]
"""/>
前回のランからインプットされた各タイトルは、今回のランに順番に渡されます。フィルタランは、インプットタイトルをソートに必要な形式に変換します。例えば、フィルタラン`[length[]]`は各インプットタイトルをその長さを表す数値に変換し、インプットタイトルを長さに基づいてソートします。
フィルタラン内では、<<.var currentTiddler>>変数が処理中のTiddlerのタイトルに設定されていることに注意してください。これにより、`:sort:number[{!!value}divide{!!cost}]`のようなフィルタランを計算に使用できます。ラン外の<<.var currentTiddler>>の値は、<<.var "..currentTiddler">>変数で使用できます。
`:sort` <<.place S>>フィルタランプレフィックスでは、複数のサフィックスを許可する拡張構文が使用されます。その一部は必須です:
```
:sort:<type>:<flaglist>[...filter run...]
```
* ''type'': 必須。項目の比較方法を決定し、''string''、''alphanumeric''、''number''、''integer''、''version''、''date''のいずれかになります。
* ''flaglist'': 次のフラグのコンマ区切りリスト:
** ''casesensitive'' または ''caseinsensitive'' (typeが`string`や`alphanumeric`のとき必須)。
*** フラグがない場合、デフォルトは: //caseinsensitive// です。
*** 明確にするために、このパラメータは常に定義する必要があります。
** フィルター実行の順序を反転するには、''reverse''を使用します(オプション)。
<<.tip """`:sort`プレフィックス付きのフィルタランは、''渡された項目と同じ数の項目が返される''ことに注意してください。特に、[[getオペレータ|get Operator]]を使用してフィールドの値を取得する場合は、[[elseオペレータ|else Operator]]を使用してフィールド値が欠落するのを防ぐと便利です。例えば`...[get[myfield]else[default-value]]`。<br><br>
''missing''エントリは''ゼロ''または''空文字列''として扱われます。
参照: <<.olink sortsub>>オペレータ
[[例|Sort Filter Run Prefix (Examples)]]

View File

@@ -0,0 +1,53 @@
created: 20230617183745774
modified: 20250504103912315
original-modified: 20230617183745774
tags: [[Then Filter Run Prefix]]
title: Then Filter Run Prefix (Examples)
ja-title: thenフィルタランプレフィックス(例)
type: text/vnd.tiddlywiki
!! 条件実行
<<.op :then>>フィルタランプレフィックスを使用すると、ネストした[[ListWidget]]や[[WikiText内のマクロ定義|Macro Definitions in WikiText]]の必要性を回避できます。
<$macrocall $name='wikitext-example-without-html'
src="""<$edit-text field="search" placeholder="Search title"/>
<$let searchTerm={{!!search}}>
<$list filter="[<searchTerm>minlength[3]] :then[!is[system]search:title<searchTerm>]" template="$:/core/ui/ListItemTemplate"/>
</$let>"""/>
!! 条件(サブ)フィルタ
<<.op :then>>フィルターランプレフィックスを<<.op :else>>プレフィックスと組み合わせて条件フィルタを作成できます。この例では、<<.var searchSubfilter>>内の検索に使用されるフィールドは[[$:/temp/searchFields]]の値に依存し、<<.var sortSubfilter>>による並べ替え順序は[[$:/temp/searchSort]]の値に依存します。これらのTiddlerの値を設定するには、チェックボックスを使用します。
<<.tip "サブフィルタ内の各フィルタランは、<<.olink subfilter>>オペレータのインプットをインプットとして受け取ることに注意してください">>
<<.olink then>>と<<.olink else>>オペレータはサブフィルタを呼び出したり追加のフィルタステップを実行できないため、このようなアプリケーションには使用できません。
<$macrocall $name='wikitext-example-without-html'
src="""<$checkbox tiddler="$:/temp/searchSort"
field="text"
checked="chrono" unchecked="alpha" default="alpha">
時系列順に並べ替え(新しい順)
</$checkbox><br/>
<$checkbox tiddler="$:/temp/searchFields"
field="text"
checked="title" unchecked="default" default="title">
<<.field title>>のみを検索
</$checkbox><p/>
<$let searchSubfilter="[{$:/temp/searchFields}match[default]] :then[search[prefix]] :else[search:title[prefix]]"
sortSubfilter="[{$:/temp/searchSort}match[chrono]] :then[!nsort[modified]] :else[sort[title]]"
limit=10 >
<$list filter="[all[tiddlers]!is[system]subfilter<searchSubfilter>subfilter<sortSubfilter>first<limit>]">
<$link/> (<$text text={{{ [{!!modified}format:date[YYYY-0MM-0DD]] }}} />)<br/>
</$list>
<$list filter="[all[tiddlers]!is[system]subfilter<searchSubfilter>rest<limit>count[]]">
... and <<currentTiddler>> more.
</$list>
</$let>"""/>
時系列順に並べ替える(新しい順)
検索titleのみ

View File

@@ -0,0 +1,41 @@
created: 20210618133745003
from-version: 5.3.0
modified: 20250423104147235
original-modified: 20230710074225410
rp-input: <<.olink すべて>>のTiddlerタイトル
rp-output: フィルタランのアウトプットは、空のリストでない限り、前回までのランのアウトプットを置き換えます(以下を参照)。
rp-purpose: フィルタランへのインプットをそのアウトプットで置き換え、インプットがある場合にのみランを評価
search:
tags: [[Named Filter Run Prefix]]
title: Then Filter Run Prefix
ja-title: thenフィルタランプレフィックス
type: text/vnd.tiddlywiki
<$railroad text="""
\start none
\end none
":then"
[["ラン"|"Filter Run"]]
"""/>
<<.op :then>>フィルターランプレフィックスは、前回までのすべてのフィルタランの結果をそのアウトプットに置き換えるために使用されます。
前回までのすべてのランの結果が空のリストの場合、<<.op :then>>プレフィックス付きフィルタランは評価されません。
<<.op :then>>プレフィックス付きフィルタランのアウトプット自体が空のリストである場合、前回までのすべてのフィルタランの結果は変更されずに渡されます。
<<.tip "空の文字列項目が1つ含まれるリストは空のリストではないことに注意してください。">>
!! <<.op :then>>ランプレフィックスと<<.olink then>>オペレータの比較
<<.op then>>オペレータと<<.op :then>>プレフィックス付きフィルタランの主な違いは、オペレータはインプット[[タイトルリスト|Title List]]の//各項目//をそのパラメータで置き換えるのに対し、<<.op :then>>オペレータは//インプットリスト全体//をそのラン結果で置き換える点です。
|doc-op-comparison tc-center|k
| !<<.op :then>>フィルタランプレフィックス | !<<.op then>>オペレータ |
|^<<.operator-example m1-1 "[tag[WikiText]] :then[[true]]">>|^<<.operator-example m1-2 "[tag[WikiText]then[true]]">><p>これらを同等にするには、追加のフィルタステップを追加します:</p> <<.operator-example m1-3 "[tag[WikiText]count[]compare:number:gt[0]then[true]]">>|
[[thenフィルタランプレフィックス(例)|Then Filter Run Prefix (Examples)]]
参照: [[elseフィルタランプレフィックス|Else Filter Run Prefix]] | [[thenオペレータ|then Operator]] と [[elseオペレータ|else Operator]]