Extracting sentences from tiddlers if they contain specific words

I’m looking for a \procedure to extract sentences from tiddlers if the sentence contain any of a specific list of words. The tiddlers of interest are to be selected using tags.

Tiddler1 (tags : nature): The cat sat on the mat. The quick brown fox.
Tiddler2 (tags : nature) : The bird sat on a branch, eating a worm. The day was sunny.
Tiddler3 (tags : astronomy) : The Earth orbits the Sun. Mercury is a planet in the solar system.

If the words of interest are [quick,Mercury, day] and tags of interest is [nature], then the output should be:

Tiddler1: The quick brown fox.
Tiddler2: The day was sunny.

Any suggestions are appreciated.

You could go so far as to program your own filter in JavaScript but that seems like overkill personally. For me it would be easier to copy/paste. But if you really want automation you could put the sentences with interest in a field and then make tiddler to render only that field for the filtered tag.

Basically…

…first filter out all tiddlers that at all have the desired tiddlers and contain the desired words.

Thereafter split the texts into individual sentences - this is where tricky edge cases come in, i.e how you define a sentence - and then just search each sentence for the desired words.

If you can define what constitutes a sentence then I don’t think it should be overly difficult.