Automated Copy Editing for the Writer





Introduction

The Problem: You have several hundred pages of text you have proof read yourself, and yet another reader points out how you missed putting a period at the end of a sentence within quote marks.  Your work contains hundreds of quotations, and all of them seemed to have been correctly punctuated.

How to achieve cleaner copy:  In OpenOffice there is a special check box in find and replace that allows you to search for patterns in text.  One such pattern that applies here is to find all the quote text snippets that lack punctuation between the last character and the close quote.  This is a very fast process that follows simple rules.

The tools in this guide can be used easily by those with modest-to-intermediate technical skills. This modest technical requirement can be found in OpenOffice Writer’s find and replace functionality when the other options button is pressed.

For those comfortable adapting to more complex actions, these tools offer powerful editing extensions through the user’s definition of a new rule. Regular expressions are powerfully flexible and adaptable.

What You Will Find Inside

The next four tables contain two rule layout format explanations, and they are followed by two examples of rules.

Rule Formats

This box explains the problem and shows it solved

This box contains example problem text with yellow highlights to reveal to reveal specific errors.

This box contains a terse description of the rule that will be shown next, below.

This box contains the Find RegEx


This box explains the problem and shows it solved

This box contains example problem text with yellow highlights to reveal specific errors.

This box contains a terse description of the rule that will be shown next, below.

The second entry below that is the rule for what to replace it with.

This box contains the Find RegEx
it may also require you to check the box marked Match case

This box contains the Replace RegEx

Rule Examples

Doubled words, s/b:

jumped over the lazy dog

jumped over over the lazy dog

Any two words in repetition (except contractions like I'll).

\b(\w+)\s+\1\b


Ones intermixed as Ls in words (not trailing 1 in a word), s/b:

Hell no!

He1l no!

Possible character, 1, at least one character

([A-Z]*|[a-z]*)1([A-Z]+|[a-z]+)

$1l$2



A Partial List of Composition Problems Covered

This shows many of the 70+ rules offered.



Repair text pasting with hard carriage returns inside of normally flowing elements, s/b:

This is an example of a cut and paste with hidden paragraph breaks within it.

This is an example of a cut and

paste with

hidden paragraph breaks within it.

Carriage return

$


Testing for conjunction of "but" used within a phrase.

And but for the grace of

word, space, “but,” space, word

[:alpha:]+ but [:alpha:]+


Conditional sentences require a comma when the if clause precedes the then clause. If the order of the sentence is reversed, a comma isn’t necessary when the if clause is essential to the meaning of the sentence, but is common and shows emphasis.

When the "then" of the then-clause is unnecessary. c/b:

If one is right, the other is wrong.

If one is right, then the other is wrong.

“if,” space, text, comma, space “then”

if [:print:]+\, then


Correlative conjunction sentence general examination.


“both”, possible successive spaced words, comma, space “and”, possible successive spaced words, period

both[ [:alnum:]+]*\, and [:alnum:]+[ [:alnum:]+]*\.


Ellipsis mis-entered, s/b:

What they did was….

What they did was....

Four periods

\.\.\.\.

.


Ellipsis normalization, s/b:

What they did was, … wonderful.

What they did was,wonderful

character+punctuation, ellipsis, character

([:alnum:][,:;])…([:alnum:])

$1 … $2


Word groups cast into paragraphs, s/b:

This is an example of a cut and paste with poor breaks inserted.

This is an example of a cut and

paste with

poor breaks inserted.

Search for carriage return, replace with white space.

$

\x0020


New sentence lacking capitalization, s/b:

Follow their lead from there on. You will also be getting the higher rate.

Follow their lead from there on. you will also be getting the higher rate.

Terminal, space, lower case alpha

(\.|\?|\!)[:space:][a-z]

Match case


Typewriter styled quote mark should be open quote mark, s/b:

“I came to the river.

"I came to the river.

Typewriter quote, any letter

"([A-Z]|[a-z])

$1


Search for unbalanced quoted material using only open quotes, s/b:

Wade, meet Carson, my roommate. Carson, this is my—

Wade, meet Carson, my roommate. Carson, this is my—

Open quote, phrase, clause, or sentence, open quote (May include speech tag inside and catch next quoted material.)

[:print:]+“