[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

Sentence Separator Macros



My view on an XPL macro to insure that sentences are separated by
one (or two) spaces is this: Any macro that attempts to
accomplish this globally, without user intervention, is almost
sure to leave errors in the text! For instance, if the desired
separation is two spaces: What about names with middle initials?
 What about abbreviations? ("Aug.?" What about "Jan.,
Feb.," et al.?! Not to mention uncommon and/or idiosyncratic
abbreviations? "30 cc. sod. pent." "The Tex. Chainsaw Mas'cr.")
What about entities like "Smith v. Jones"? And so on, ad
infinitum.

I think user intervention is inevitable here; it's not unduly
burdensome and, in any event, it's the safest approach. The XPL
is easy. Just SEarch for the possible error, and ask. Here are two sample macros, one for
XyIII+, one for Xy4 and XyWin, that check all sentence separators
(including the two Spanish-language separators, which may or may
not survive E-mail) and change one space to two on request:

For Xy4|XyWin:
TF BX cv /{S} {A}/{S} {A}/Q2

For XyIII+ v3.54+:
[SX01,[VA$EB]]BC d eb=0,0XC BC [SV02,Y][SV03,][SV04,.|?|!|?|!||]
[SV05,{Esc}][SV06,|][SV07,][LBa][XS04,06,07,08,09][IF@siz([IS07])
<1][GLc]
[EI][SX04,[IS09]]TF [LBb]BC se /[PV07] {A}/XC [IF[ER]][GLa][EI]
[PRChange to 2 spaces?
(Y|N|Esc)][SX10,@upr([RC])][IF[IS10]==[is05]]
[LBc]BC d eb=[PV01]XC BC GT[PRDone][EX][EI][IF[IS10]==[IS02]]
CL CL [GT03][EI][GLb]

To convert these into working programs, do the following:
 - Toggle into eXPanded view
 - Change left brackets to left guillemets (1-byte Euro quotes)
 - Change right brackets to right guillemets
 - Change function mnemonics (BC ,XC , etc.) to real embedded functions,
   e.g. delete "BC " and command PFUN BC
 - Change {Esc} to the Escape character
 - Change {A} to the Wild Alpha search wildcard
 - Change {S} to the wild sentence separator search wildcard (Xy4)
 - Delete all hard carriage returns within the code

The Xy3 macro has to be prolix for reasons too numerous to discuss at 12:22
AM. Note that the sentence separator wildcard enables the
operation to be accomplished in a single pass through the
document in Xy4 and XyWin.

--------------
Carl Distefano
70154.3452@xxxxxxxx