Closed GregTheGrate closed 3 years ago
Another example --- stil didn't sound right
I massaged my forehead, which was now throbbing not just from a mistral-induced headache, but from this surreal conversation. Eli's story stil didn't sound right. He'd left something out. "What aren't you telling me?"
tol booth --- toll is in the list
The Jaguar purred toward the tol booth and slid onto the highway. Office buildings in various stages of construction sprouted like weeds after rain on both sides of the road. Red gashes in the clay soil looked like open sores where the earth had been bul dozed and flattened. Two years ago this had been farmland. Maybe if I'd seen the destruction unfold gradually it would have seemed less brutal.
had been bul dozed and -----bull is in the list so should have been changed. Will add bulldozed
stil haunted me
Last night's conversation with Fitz in the tropical darkness, his whispered accusations and revelations in the shadowy recesses of that porch, stil haunted me. For the rest of the evening I'd felt like a sleepwalker, the jet lag clouding my judgment about what was real and what I'd imagined.
smal corridor
Directly off the main room an arched wrought iron gate led to the wine library with its deep leather chairs, wine barrel end tables, and our growing collection of books on colonial and contemporary wine making. A heavy door that always reminded me of the entrance to a monk's cell led to a smal corridor and the offices.
wil you
"Over here." Mason pointed under an end table. He stood up and peered at the spot he'd just indicated. "It's too dark. Hand me that lantern, wil you?"
wel byond
It probably wasn't the smartest decision in the world to try to hang on to the vineyard when Leland had left us nearly bankrupt. Our new vintner seemed like the kind of guy you'd hire as a bouncer at a night club. Eli was right that Highland House, neglected for years, needed repairs that were wel beyond our bank balance.
ripening al together. --- have added alltogether, but shouldn't it have corrected al?
recal ----recall is in the list
What was surprising was that she'd stopped writing for one two-year cycle--or else that volume was missing. I did some figuring, trying to recal what happened twenty years ago.
pil ow--
fixed with hyphen move #6 stil didn't
does not match because only one space between till
and did
.tol booth
is one word; added tollbooth
to the search list. Only one space between ol
and bo
.bul dozed
is one word; added bulldozed
to the search list. Only one space between ul
and do
.stil haunted
Only one space between il
and ha
.smal corridor
, wel beyond
, ditto.ripening al together
- I think we shouldn't add alltogether
(not a word). If we take that out of the search, all
should work as long as there's two spaces between: al together
. We might need to look at l
(i.e. ll
) at end of words.recal
Only one space between al
and wh
.Various updates in script to account for LL at the end of a word (both in middle and at start of sentence), e.g. alltogether
.
# find edge case: words ending in ll that don't have two spaces before next word.
my @ends_with_ll = grep { m/l\s$/ } keys %replace;
...
my $regex_ends_with_ll = join "|", map { quotemeta } sort { $b cmp $a } @ends_with_ll;
...
$regex_ends_with_ll = qr/$regex_ends_with_ll/;
...
my @matches_ends_with_ll = $line =~ /(?<=[$before])($regex_ends_with_ll)(?=\w)/g;
my @matches_ends_with_ll_startline = $line =~ /^($regex_ends_with_ll)(?=\w)/g;
my $count = scalar @matches + scalar @matches_startline +
scalar @matches_ends_with_ll + scalar @matches_ends_with_ll_startline;
...
# fix any words that matched
$line =~ s/(?<=[$before])($regex_ends_with_ll)(?=\w)/$replace{$1} /g; # edge case ends with ll
$line =~ s/^($regex_ends_with_ll)(?=\w)/$replace{$1} /g; # ends with ll at start of line
...
#add the matches to the list of all matches for the file
@all_matches = uniq(@all_matches, @matches, @matches_startline,
@matches_ends_with_ll, @matches_ends_with_ll_startline);
the pil ow--"sleeping o ----- pillow is in the list