MODERATOR'S NOTE:
⠀See the most recent version in Post #21.
⠀Macro: Literary Toolbox
⠀Author: Mike Pasini
⠀Version: 1.0a
⠀Last Update: 3 December 2018
This set of macros can be used to evaluate text in several different ways. They can be helpful to authors but also to readers evaluating or studying various texts.
They each work on a text selection rather than a discrete file, parsing the selection copied to the clipboard and stripping it of any style information before analysis.
That helps (if isn't quite a cure) for text selected in a word processor. But you should have no problem with text selections made in any editor or within a Web browser.
Some of the tools push the limits of what an algorithm can tell us about human communication but we still find them useful if not for raw data at least for comparisons or trends.
We've used some of these for years and some for a few months. And while they do tap into the power of some third-party code, only a couple rely on commercial software and even those have free equivalents.
Keyboard Maestro provides a simple interface to these tools. A palette (with an optional custom color scheme) organizes them for easy recall. And custom HTML forms that use the same color scheme as the palette provide easy-to-read reports.
Sample reports:
The .zip file contains the PDF documentation and the complete palette.
BernsHome$ curl -L http://cpanmin.us | perl - --sudo App::cpanminus
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 295k 100 295k 0 0 1134k 0 --:--:-- --:--:-- --:--:-- 1137k
--> Working on App::cpanminus
Fetching http://www.cpan.org/authors/id/M/MI/MIYAGAWA/App-cpanminus-1.7044.tar.gz ... OK
Configuring App-cpanminus-1.7044 ... OK
Building and testing App-cpanminus-1.7044 ... FAIL
! Installing App::cpanminus failed. See /Users/BernsHome/.cpanm/work/1544194574.41445/build.log for details. Retry with --force to force install it.
Here's the last line of the build.log with the failed step:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
-> FAIL Installing App::cpanminus failed. See /Users/BernsHome/.cpanm/work/1544194574.41445/build.log for details. Retry with --force to force install it.
Installing the command line developer tools handled the cpanminus install.
Now the last distribution from "cpan at https://metacpan.org/ pod/Lingua::EN::Grammarian" to retrieve the caution and error files returns a 404 page not found error.
That URL looks suspicious (there's a space in it). But the original source does specify this command line:
cpanm Lingua::EN::Grammarian
(And you'll need that link to get the error and caution files, too.)
Addendum:
I found the cpan install for Grammarian from my Terminal session and it looks like this:
MikePasinisMBP:~ mrpasini$ cpanm Lingua::EN::Grammarian --sudo
--> Working on Lingua::EN::Grammarian
Fetching http://www.cpan.org/authors/id/D/DC/DCONWAY/Lingua-EN-Grammarian-0.000005.tar.gz ... OK
Configuring Lingua-EN-Grammarian-0.000005 ... OK
Building and testing Lingua-EN-Grammarian-0.000005 ... Password:
OK
Successfully installed Lingua-EN-Grammarian-0.000005
1 distribution installed
You are correct. The Literary Toolbox pdf version has that URL with a line wrap. Copying and pasting from the pdf inserts a space where the line wraps to the next line. Removing the space got me to the correct page.
Hi, I managed to install everything but some macros are not running. During the installation process these were the errors:
ERROR #1
==> Found dependencies: Package::Stash::XS
--> Working on Package::Stash::XS
Fetching http://www.cpan.org/authors/id/E/ET/ETHER/Package-Stash-XS-0.29.tar.gz ... OK
Configuring Package-Stash-XS-0.29 ... OK
Building and testing Package-Stash-XS-0.29 ... FAIL
! Installing Package::Stash::XS failed. See /Users/Alfredo/.cpanm/work/1547686509.2318/build.log for details. Retry with --force to force install it.
! Installing the dependencies failed: Module 'Package::Stash::XS' is not installed
! Bailing out the installation for Package-Stash-0.38.
! Installing the dependencies failed: Module 'Package::Stash' is not installed
! Bailing out the installation for namespace-clean-0.27.
! Installing the dependencies failed: Module 'namespace::clean' is not installed, Module 'strictures' is not installed
! Bailing out the installation for Lingua-EN-Opinion-0.1300.
ERROR #2
Configuring Lingua-EN-Tagger-0.30 ... OK
==> Found dependencies: HTML::Parser
--> Working on HTML::Parser
Fetching http://www.cpan.org/authors/id/G/GA/GAAS/HTML-Parser-3.72.tar.gz ... OK
Configuring HTML-Parser-3.72 ... OK
Building and testing HTML-Parser-3.72 ... FAIL
! Installing HTML::Parser failed. See /Users/Alfredo/.cpanm/work/1547686534.3287/build.log for details. Retry with --force to force install it.
! Installing the dependencies failed: Module 'HTML::Parser' is not installed
! Bailing out the installation for Lingua-EN-Tagger-0.30.
Nevertheless, for some functions I still receive this ERROR:
"Can't locate Lingua/EN/Fathom.pm in @INC (you may need to install the Lingua::EN::Fathom module) (@INC contains: /Library/Perl/5.18/darwin-thread-multi-2level /Library/Perl/5.18 /Network/Library/Perl/5.18/darwin-thread-multi-2level /Network/Library/Perl/5.18 /Library/Perl/Updates/5.18.2 /System/Library/Perl/5.18/darwin-thread-multi-2level /System/Library/Perl/5.18 /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level /System/Library/Perl/Extras/5.18 .) at /var/folders/py/gvw054lj2j171rhjn6zd01kh0000gn/T/Keyboard-Maestro-Script-A353C5A9-22B9-453F-A67C-BF4821581A95 line 3. BEGIN failed--compilation aborted at /var/folders/py/gvw054lj2j171rhjn6zd01kh0000gn/T/Keyboard-Maestro-Script-A353C5A9-22B9-453F-A67C-BF4821581A95 line 3."
Well, same answer as last time. Your Perl installation is not standard.
MacOS ships with Perl installed (and has for a long time). On Sierra, which is what I'm running, the installed version is v5.18.2 and can be found in /usr/bin/.
Assuming that installation, cpanm will install the required modules where Perl can find them.
The error message you are getting is telling you that your Perl installation can't find the required modules in any of the places it normally looks (that's what the @INC is all about). You'll notice most of those places are in "5.18" subdirectories, which would not be accessed by Perl v5.28.
You can add directories to that list, of course, but I suspect you don't know where the modules were installed.
If, that is, the modules have actually been installed, which isn't clear. That would have appeared between steps 4 and 5.
You might try reinstalling the modules so they're accessible to your new Perl installation. Or, failing that, fall back to Perl 5.18, which is what your @INC is expecting.
With a clean install of MacOS, you don't need to install Perl and the default Perl installation will find any modules installed by cpanm.
You have a custom install of Perl somewhere on your disk ("which Perl" in Terminal will tell you where) and that install can't find the required modules for this palette.
I discovered an issue with the regex in the Most Frequentlty Used option which did not isolate the strings as complete words, omitting longer words from the counts. Version 1.0b corrects that:
Thanks for the update.
To ensure that all new readers see your latest update, I added your update post to your OP. Please feel free to further edit if you so desire.
I think the command for custom palette change through the terminal is wrong in the manual. It is missing "-string". So it worked for me after entering the command like this:
On another note, when I moved to Mojave I had to change the way Spell Catcher is called to check a document. I still prefer its batch mode but I suspect I'm the last person on earth using it.
I'll include that revision (as well as the two-column Most Used Words and Word Frequency reports) in the update coming shortly.
This release uses a two-column display for the Most Used Words and Word Frequency reports, updates the Spell Catcher batch spell check to work with Mojave (thanks to Chris Stone) and updates the documentation to use the current syntax for the custom theme (thanks to slimhan).