Hi Christopher,
You could aggregate your patterns into a single regular expression and use
it directly from BBEdit
with the benefit of result sets, multi-file searches, matches highlighting,
etc.
Here is an unrolled example pattern:
(?xx)
(?i) (?# Case insensitive.)
(?n) (?# No auto capture.)
\b
(
( (?#: Weasel words.)
zzz
|very
|vast
|various
|tiny
|surprisingly
|substantially
|significantly
|several
|remarkably
|relatively
|quite
|mostly
|many
|largely
|interestingly
|huge
|few
|fairly
|extremely
|excellent
|exceedingly
|completely
|clearly
|((are|is) a number)
)
|
( (?#: Passive voices.)
zzz
|wrung
|written
|woven
|wound
|worn
|won
|woken
|withstood
|withheld
|wept
|wed
|upset
|upheld
|understood
|trodden
|torn
|told
|thrust
|thrown
|thrived
|thought
|taught
|taken
|swung
|swum
|sworn
|swollen
|swept
|sunk
|sung
|stunk
|stung
|stuck
|strung
|struck
|striven
|stridden
|stood
|stolen
|spun
|sprung
|spread
|spoken
|split
|spit
|spilt
|spent
|sped
|sown
|sought
|sold
|smitten
|slung
|slit
|slid
|slept
|slain
|shut
|shrunk
|shown
|shot
|shorn
|shone
|shod
|shed
|shaven
|shaken
|sewn
|set
|sent
|seen
|sawn
|sat
|said
|rung
|run
|risen
|ridden
|rid
|read
|quit
|put
|proven
|pled
|paid
|overthrown
|overtaken
|overdone
|overcome
|mown
|mistaken
|misspelt
|met
|meant
|made
|lost
|lighted
|let
|lent
|left
|led
|learnt
|leapt
|lain
|laid
|known
|knit
|knelt
|kept
|hurt
|hung
|hit
|hidden
|held
|heard
|grown
|ground
|gotten
|gone
|given
|frozen
|found
|fought
|forsaken
|forgotten
|forgiven
|foregone
|forbidden
|flung
|flown
|fled
|fit
|felt
|fed
|fallen
|eaten
|dug
|drunk
|driven
|dreamt
|drawn
|done
|dived
|dealt
|cut
|crept
|cost
|come
|clung
|chosen
|caught
|cast
|burst
|burnt
|built
|brought
|broken
|broadcast
|bred
|bound
|bought
|born
|blown
|bled
|bitten
|bidden
|bid
|bet
|beset
|bent
|begun
|been
|become
|beat
|awoken
)
|
(?P<DUPLICATE>\p{L}{2,})\s+(?P=DUPLICATE) (?#: Duplicate words.)
)
\b
HTH
Jean Jourdain
On Tuesday, December 19, 2023 at 10:40:42 PM UTC+1 Christopher Finazzo
wrote:
> I am consolidating a set of proofreading scripts
> <https://matt.might.net/articles/shell-scripts-for-passive-voice-weasel-words-duplicates/>
>
> into a Makefile that includes a "proof" rule. This rule calls each of the
> underlying scripts - and Aspell <http://aspell.net> - in sequence. At the
> moment, running these will print output to the screen, but I would like to
> go one step further.
>
> As these are "interactive" scripts, which return a text UI when run, is it
> possible to pass the results to bbresults and present matching items in a
> differences window?
>
> The end result would look similar to the following:
>
> proof:
> duplicates.sh
> passive-voice.sh
> weasel-words.sh
> aspell check $document
>
> I have done something similar with a function bbshellcheck, which has the
> following form:
>
> bbshellcheck {
> shellcheck -f gcc "$@" | bbresults
> }
>
> On paper, this makes sense. However, it isn't working exactly as I expect
> -- Is this the wrong approach, or am I missing something obvious?
>
--
This is the BBEdit Talk public discussion group. If you have a feature request
or need technical support, please email "[email protected]" rather than
posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
---
You received this message because you are subscribed to the Google Groups
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/bbedit/0b6ff504-e585-476c-a5c0-8e25b85b05dbn%40googlegroups.com.