FOR MACOS USERS ONLY:
I used this script to find every full sentence with the word ‘inequity’ in the theory book, then save it to a file called inequity.txt.
(this is a single line)
perl -MLingua::EN::Sentence=get_sentences -ne ‘print "$\n" for grep { /inequity/ } @{get_sentences($)}’ <(tr ‘\n’ ’ ’ < dramatica-theory-book.txt) > inequity.txt
You have to install the Lingua::EN::Sentence module in perl, and then you have to set the PERL5LIB in bash_profile to the correct path for the library. In my case that’s
export PERL5LIB=$HOME/perl5/lib/perl5
====
here’s how you can install Perl modules:
*You can enter the Perl shell to install the modules you want.
*perl -MCPAN -e shell.
*to install the module type. install module name. Example: install Lingua::EN::Sentence
*make the shell significantly more user friendly type. install Bundle::CPAN. highly recommended.
====
I used convertio.co to turn the theory book pdf into a text file, the better for string searches.
====
I got output like this:
In a sense, these Char-
acters are made more interesting by creating an inequity within them even as they
continue to represent methods of problem solving within the Story Mind.
The trial of Tom Robinson brings all of the
towns’ people into squabbles about inequity in the treatment of
different races, inequity among the social classes of people, their
levels of income, and their educations.
Scout, as the Main Character, is driven by her personal problem
of inequity.
Kept at the margins of the Overall Story dealings with the
problem of inequity, Scout however comes to see her prejudice
against Boo Radley as being every bit as wrong.
The resolution may be to rearrange one’s environment or to come to terms
with the environment as it is. Regardless of the source of the inequity or the means
employed to resolve it, all thinking creatures try to maximize their pleasure and minimize
their pain.
Or, we
change the nature of the forces at work that determine the processes that sustain the
inequity, so that it dissolves when its foundation is eroded.
Problem solving requires identifying the source of the inequity and/or the kind of
effort that will bring an end to it.
Each of these requirements depends upon an accurate
assessment of the mechanism that generates the inequity, and therein lies the opportu-
nity for error.
====
here’s the original stackoverflow article that told me how to do this.
====
this method should be easily adaptable for Windows users, as perl is cross platform. i’m sure there’s some grep for Windows, or the equivalent, that would work.