Category Archives: Writing in general

Finding doubled words using perl

I recently switched to Scrivener for writing my documents. Much more enjoyable interface than Word, with lots of nifty features for writers. One big issue: I’m still getting used to Scrivener’s spellchecker. Microsoft Word finds doubled words right out of the box, but Scrivener does not.

The script below is written in perl, which comes pre-installed on Macs. If you paste it into a text file, make the file executable, and then run it in the same directory with a file called “infile.txt” (a cut/paste from Word to the file will do nicely), it will report your doubled words.

*update* – the script won’t catch things like: “bang bang” because the quotes make it think it’s 2 patterns.  Working on it 🙂

Example input (infile.txt):

This is a line
This is another line
And yet another line
wow I sure do a lot of lines, "Don't I?" he said (in a funny voice)...
Wow it sure is is fune typing all this
I like dogs and cats and stuff.
Big big is funner than small people.
how are are the dodgers doing this year? Nobody knows.
more lines and stuff...
etc. etc.
good things come to those who write scripts in perl and post them on the internet

Example Output:

is is ---->  Wow it sure is is fune typing all this
big big ---->  Big big is funner than small people.
are are ---->  how are are the dodgers doing this year? Nobody knows.
etc. etc. ---->  etc. etc.

And now the script: rep.pl

#!/usr/bin/perl
open(FILE,"infile.txt") or die "Can't open infile.txt: $!";
$section_breaks = "*";  # I have * * * as section breaks. The script sees them as words and should ignore them.
while(<FILE>) {
   chomp();
   $a_line = $_;
   @line = split(/ /, $_);
   $prev = 0;   
   foreach $i (@line) {
      $i = lc($i);
      if ($i eq $prev && $i ne $section_breaks) {
         print "$prev $i ---->  $a_line\n";
      }
      $prev = $i;
   }
}
close(FILE);
Advertisements

10 Comments

Filed under Grammar/Punctuation, Tools for Writers, Writing in general

Two posts in one: Book 3 is done, and I need Facebook likes

I only like posting once a day here, if possible, because I know folks get emailed every time. So for the first time ever on this blog, I’m harnessing the Power of Cyberspace and merging two posts into one. Maybe five years from now, when people are merging four and even five posts together, we’ll all look back and laugh. But for now, this is cutting edge stuff!

Post 1: Facebook likes

I’m doing a little paid Facebook advertising ($$), and my reach is based on the number of likes on my page. So I could really use more likes. Am I asking for likes? You bet! If you follow the link and then click “Like” I’ll be your best friend forever.

https://www.facebook.com/pages/John-L-Monk/438937726219898

Post 2: Book 3 is done

Ugh, finally — FINALLY — I finished all the parts and pieces and rewrites of Book 3 of The Jenkins Cycle (title to be released later, hehe). Wow, it took a while. I thought when I finished the first draft in January it’d go quick. Boy was I wrong.  Lots of rewriting and agonizing and complaining and whining and profanity and conjunction after conjunction. What’s their function? Beats me, I just type stuff. Anyway, it’s done. I have to read it again, weeding out as many typos as I can, as many inconsistencies as possible, and then I need to get it to beta readers.  After that, I hope to hire 2 proofreaders — back to back — to find the last problems. Then I publish. I sincerely hope this is in July, and wish it were sooner. Still lots to do, but the hard part is over. Nothing bad can happen now.

4 Comments

Filed under Writing Experience, Writing in general

Enough with the Apple stuff, where’s book 3??

I imagine millions of you, perhaps trillions, are wondering, “Where-oh-where is book 3 of the Jenkins Cycle?!”

Short Answer: it should be out this summer, hopefully by July.

Long Answer (see below):

Though I finished the draft in January, it was a banged-up mess. I’d followed a different tactic in writing this one than I had for book 1, and which I’d started to implement in book 2: I plotted as best I could (loosely) and wrote without revising as I went along.

I’ve always plotted loosely, but one thing I did in book 1 was write a thousand or so words, then went back and tweaked it to pieces (then farther back tweaking anything that needed to match up (and so on (and so on))) and after that, started writing new chapters.  I did that a little in book 2 as well, and that helped keep it sort of solid for when I finished the draft. Revisions weren’t that hard (though I’d re-read the book like 10 times, which was mind-numbing). But in book 3, I did NO revisions as I shot forward. I followed a bunch of advice from top-selling folks who said, “Just keep writing, knock it out, leave the mistakes in, fix it later.” It seemed like brilliant advice.

But when I finished the draft, as I said: it was a banged-up mess.  It was about 65k words, the reason being I’d left out portions of the story that would slow me down. “Read about organized crime law later” my internal timekeeper/drill sergeant yelled, and so I left notes in brackets: [ put the legal stuff here ] or [ big fight scene on top of a jetliner here ] or [ put words here ] or whatever.

So that’s what I’ve been doing since January: going through and adding the things I missed, revising lots of plot holes, making sure people’s names don’t change from chapter to chapter, eradicating unneeded sections, and doing all the thinking I would have done in book 1 as I crept along. All those missing sections, incidentally, have the book sitting at 84k words (without any “fluffing,” in case you’re wondering).

Dean Wesley Smith says the way I did book 1, more or less, is called “Writing into the dark.” He even wrote a book about it titled: “Writing into the dark.” It’s a method of writing where you venture forward with no outline, and you finish the book after you write the last word.  Even with “Kick” I wasn’t that efficient, but I did basically do this. I did it a little with Fool’s Ride (various chapters would get this treatment). And not at all with Book Three.

This wasn’t supposed to be a book endorsement, but it sort of is. Highly recommend picking up Smith’s book and seeing if maybe it’s something that would appeal to you. He makes a lot of great arguments.

2 Comments

Filed under Word Counts, Writing in general

Trixy Chestity: Zombie Apocalypse

I almost decided not to publish this story or make it available. Mainly because it departs somewhat from my other Trixy Chestity story, which I published in Stories On The Go.  The Trixy in the Zombie Apocalypse is a bit more mercenary, to quote Awesome Indie Lindy Moone.  Still, I think it’s a fun little story.  I decided to offer it free on Amazon’s brand new site “Write On” — essentially, their answer to Wattpad.

Enjoy:

trixy_chestity

Leave a comment

Filed under Funny, Writing in general

New Release: Thief’s Odyssey

thief_blog

Cover Art by Keith Draws https://keithdraws.wordpress.com/

Two years ago, I wrote Thief’s Odyssey from a sense of frustration with Hollywood movies that depict thieves. Often they were bang-bang bank robbery stories (tons of them), had overly elaborate stories relying on a magical hacker to open the vault (Die Hard), the steps involved in breaking in somewhere were impossibly timed (Hudson Hawk, Oceans 11-25), or the breaking-in relied on a lot of messy destruction and vandalism (The Score).

By the way, I loved Hudson Hawk and The Score.  But I wanted to write the kind of story that really fleshed out the myth of the “Master Thief.”  Someone who looks at what he does as almost an art, does it for the challenge alone, and isn’t constantly promising his girlfriend, “This is the last job, baby, I swear…then we’ll get that white picket fence.”  I also wanted to show realistic depictions of safecracking, lock picking, the bypassing of alarms, hacking, identity theft, and even smuggling.

Fans of Kick will enjoy the loner main character, and the first person narrative (though somewhat more hard-boiled than Dan Jenkins). And if you’ve ever flushed with excitement after swiping a grape at the grocery store, you might enjoy all the cool crime going on, too.

One of my big inspirations when writing Thief’s Odyssey was Bill Mason’s non-fiction memoir, Confessions of a Master Jewel Thief — highly recommended.

13 Comments

Filed under Writing in general

E.E. Giorgi — Scientist, Artist, Writer: 8 Things Authors Should Know About Viruses

E.E. Giorgi, who recently did a book cover for a short story I released under the pen name “J.M. Waltz,” has written a fascinating guest blog post about viruses: 8 Things Authors Should Know About Viruses.  If you only know 3 things, go there to find out the 5 you’re missing! 🙂

 

Leave a comment

Filed under Just Cool, Writing in general

Another interview with Russell Blake

I pretty much enjoy all the interviews with Russell Blake, and am about to listen to this one now.

http://theauthorbiz.com/tab027-focus-writing-russell-blake/

*Update*

This guy really digs in and asks good questions based on pre-show research, etc.

5 Comments

Filed under Indie Publishing, Writing in general, Writing Market