Capitalization

Everything related to our flagship word processor.
bodsham
Posts: 4
Joined: 2005-08-23 00:30:19

Post by bodsham »

OK - so Nisus is right, and Word, Pages, Scrivener and all the others are wrong. I wonder which ones sell more??? All I was suggesting was that this very popular feature is offered as an option - not that any of you people who appear to write in abbreviations be forced to use it. The fact it's not there adds an annoying an unnecessary and boring chore to my everyday writing that I haven't had to do since for a decade or more. Its absence puts me off Nisus frankly, and I suspect I am not alone. Software should offer choices.
rallx
Posts: 38
Joined: 2004-09-11 12:05:03

Capitalizing first letters with powerFind

Post by rallx »

Here is a simple PowerFindPro search and replace strings to capitalize first words of sentences. This particular example also replaces more than one space with between sentences with just one.

1. Paste this (omit quotes) into the Find What box: ". +([a-z])"

2. Paste this (also omit quotes) into the Replace With Box: ". \1"

3. Select the "\1" in the Replace With box, go to the Format:Character Case menu/submenu of the main program and select Display as upper case. (make sure that the Find box is in front and not the document window).

4. Check the "Attribute sensitive" check box beneath the Replace With part of the Find dialog. (also make sure that Ignore Case is NOT checked).


Then you can either go through the hits one by one in your document, changing only those cases that you want, or you can do a replace all. You can save this expression, or this could easily be turned into a macro.
gemboy27
Posts: 355
Joined: 2003-09-30 21:33:58

Tour de France is on now

Post by gemboy27 »

bodsham wrote:OK - so Nisus is right, and Word, Pages, Scrivener and all the others are wrong. I wonder which ones sell more??? .
This is a good question? I actually wonder how many people actually out and out buy word. Since it is included with so many PCs --- an option that you don't have any choice on. To own Nisus Writer Exress or Nisus Writer Pro you actually had to make a choice of buying it, after you sought it out and then after you probably tested a demo.

I wonder where that stat would be.

Just did a google search for this question

here is an interesting article

New York Times Artcle
I have never let my schooling interfere with my education/Mark Twain (1835-1910)
Ryan
Posts: 211
Joined: 2005-01-31 14:36:45
Location: Portland, OR
Contact:

Re: Capitalizing first letters with powerFind

Post by Ryan »

rallx wrote:Here is a simple PowerFindPro search and replace strings to capitalize first words of sentences. This particular example also replaces more than one space with between sentences with just one.

1. Paste this (omit quotes) into the Find What box: ". +([a-z])"

2. Paste this (also omit quotes) into the Replace With Box: ". \1"

3. Select the "\1" in the Replace With box, go to the Format:Character Case menu/submenu of the main program and select Display as upper case. (make sure that the Find box is in front and not the document window).

4. Check the "Attribute sensitive" check box beneath the Replace With part of the Find dialog. (also make sure that Ignore Case is NOT checked).


Then you can either go through the hits one by one in your document, changing only those cases that you want, or you can do a replace all. You can save this expression, or this could easily be turned into a macro.
Wow. Good answer.
User avatar
greenmorpher
Posts: 767
Joined: 2007-04-12 04:01:46
Location: Melbourne, Australia
Contact:

Post by greenmorpher »

And here is the story behind THAT story. I just happened to come acorss it a fews days ago and posted it to the Dartmouth list where we are discussing these matters.

http://blogs.msdn.com/rick_schaut/archi ... 80193.aspx

I am in sympathy with bodsham that finding the missing caps would be of real benefit. Unlike him, I wouldn't want automatic correction -- I have a fairly dumb algorithm of that nature in one of my DTP programs, and it left me with some rather embarrassing caps where I didn’t want caps on one occasion because it didn’t take abbreviations into account. In addition, I wonder whether making the auto-correction foolproof would result in bloat. You'll notice mention in the blog above of the memory hungry nature of the grammar stuff (of course, that was 10+ years ago -- but have things changed much in that respect?).

The incomparable Kino on the Dartmouth list came up with the following Powerfind Pro expression for catching lower case following a full stop with all kinds of non-printing characters between them:

(?c)[\n\f][\x201C\x2018\x27"]*[[:lower:]]|\x2028[\x201C\x2018\x27"]*[[:lower:]]|[.!?\x2026][\x201D\x2019\x27"]*[\t\x20]+[\x201C\x2018\x27"]*[[:lower:]]

Try copying and pasting it into Powerfind Pro "Find" window, and it will take you through the document. My preference is to correct manually because of the relatively small number of such errors and the fact that you also look like a total idiot if you have the opposite error -- a cap after an abbreviation.

Turning this into a macro taking note of the exceptions in the dictionary isn't possible, Kino says, because an NW Pro macro doesn't have access to the dictionary.

The difficulties of doing grammar is illustrated in an in-depth discussion on the Dartmouth list of the use of Grammarian -- a very mature grammar program for Mac. The difficulties are twofold -- price and function.

PRICE: Grammarian costs $39.95, i.e. nearly the price of NWE and more than half the price of NWPro. Those prices tell you what a Nisus Writer with built in grammar tools would have to cost -- NWE would be about $80 instead of $45 while NW Pro would be in the $110 range. Would you want to pay that much?

FUNCTION: If you are interested in this, you should go over to the Dartmouth List and have a look. Email the command (omit quotes) SUBSCRIBE NISUS Your Name" (where Your Name, is, of course, your name) to "LISTSERV@LISTSERV.DARTMOUTH.EDU". Some of the people there have conducted some very useful tests with it.

Cheers, Geoff

Geoffrey Heard, Business Writer & Publisher

"Type & Layout: Are you communicating or just making pretty shapes" -- Revealed! The secrets of how you can use type and layout to turbocharge your messages in print. See the book at http://www.worsleypress.com
Anne Cuneo
Posts: 164
Joined: 2004-09-23 02:15:46
Location: Switzerland
Contact:

Post by Anne Cuneo »

You keep mentioning “the Dartmouth list”. Being from the other side of the Atlantic, I venture the timid question : keseksa (cellphone language for “qu'est-ce que c'est que cela”)? In other words, what is the Darmouth list, and how does one find it? Thanks for telling me.
Anne
User avatar
Hamid
Posts: 777
Joined: 2007-01-17 03:25:42

the Dartmouth list

Post by Hamid »

To join the list:
http://tinyurl.com/3yjwu5

To browse the archives
http://tinyurl.com/2m5y7f
Anne Cuneo
Posts: 164
Joined: 2004-09-23 02:15:46
Location: Switzerland
Contact:

Post by Anne Cuneo »

Thanks I just did it, I am going to browse through the archive tonight. :drunk:
Anne
wlafi
Posts: 5
Joined: 2010-05-26 06:44:22

Re: Capitalization

Post by wlafi »

HELP!

Hi, my problem is, any of the proposed find/replace operations just FORMAT the searched for sign (e.g. first letter) ti DISPLAY AS upper case. But if I want to do any further formatting, the letter will switch back to its original format.

Here is the problem:

I want to replace person names typed in upper case into small caps, but as all signs are typed in the same case, changing them to small caps will result in displaying everything in upper case again. So, I first changed everything to lower case and then to small caps. But now, the first letters are not capitalized, which doesn't look good in person names!

So, I tried replacing first signs in words with DISPLAY in UPPER CASE. That worked, but, as I said, if I want to do any changes to the formats, the first letters will switch back to lower case and all effort is lost!

Does anyone have a solution to this? Or is it like that the way signs were typed cannot be changed automatically, but only their format?
Kino
Posts: 400
Joined: 2008-05-17 04:02:32

Re: Capitalization

Post by Kino »

wlafi wrote:I want to replace person names typed in upper case into small caps [ . . . ]
What you have to do is . . .
1. Select person name(s);
2. Apply Edit:Convert:To Capitalized;
3. Apply Format:Character Case:Display as Small Caps.

Note that Display as Small Caps command does not change characters but just change the way they are shown. In other words, “Firstname Familyname” remains “Firstname Familyname”.
wlafi
Posts: 5
Joined: 2010-05-26 06:44:22

Re: Capitalization

Post by wlafi »

Note that Display as Small Caps command does not change characters but just change the way they are shown. In other words, “Firstname Familyname” remains “Firstname Familyname”.
Hi and thank you ... what you note is exactly the problem: I have several texts with hundreds of names in the format "FIRSTNAME FAMILYNAME" and I want to transform them into "Firstname Familyname" and then make them small caps. But this seems to be impossible unless I do it all by hand.

A workaround seems to be to use the placeholder an position commands in find/replace and replace the first letters with caps. But this can easily backfire as soon as I reformat the text (see original post).

Any suggestions out there?
Kino
Posts: 400
Joined: 2008-05-17 04:02:32

Re: Capitalization

Post by Kino »

wlafi wrote:I have several texts with hundreds of names in the format "FIRSTNAME FAMILYNAME" and I want to transform them into "Firstname Familyname" and then make them small caps. But this seems to be impossible unless I do it all by hand.
How about this?
1. Open the Find panel;
2. Set Using: to PowerFind Pro;
3. Check Whole Word;
4. Type \p{Upper}{3,} \p{Upper}{3,} in the find field and hit Find All to select “FIRSTNAME FAMILYNAME”s;
5. Click on the toolbar of the document window to make it active;
6. Apply Edit:Convert:To Capitalized;
7. Apply Format:Character Case:Display as Small Caps.

I tend to think there is no first or family name shorter than 3 letters. But, if my assumption is wrong, try \p{Upper}{2,} \p{Upper}{3,} or something alike.
find.png
find.png (55.7 KiB) Viewed 13800 times
wlafi
Posts: 5
Joined: 2010-05-26 06:44:22

Re: Capitalization

Post by wlafi »

Thank you very much for the code!

It worked partly, and it works even if I reformat. But all the FAMILYNAMEs in first position were not reformatted. And in footnotes, none.

Result:
Bildschirmfoto 2010-05-27 um 11.10.43.png
Bildschirmfoto 2010-05-27 um 11.10.43.png (40.89 KiB) Viewed 13798 times
Kino
Posts: 400
Joined: 2008-05-17 04:02:32

Re: Capitalization

Post by Kino »

wlafi wrote:But all the FAMILYNAMEs in first position were not reformatted.
Because you did not show any example. You cannot expect other’s infinit imagination ;-) Anyway, your screen shot shows that [1] some names do not have first name, e.g. “GREVERUS”, [2] some first or family names consist of two names separated by a hyphen, e.g. “Ina-Maria Greverus” and [3] the format of some names is not “FIRSTNAME FAMILYNAME” but “FAMILYNAME, FIRSTNAME”.

Try “(?<n>\p{Upper}{3,}(?:-\p{Upper}{3,})?)(?:,? \g<n>)*” as the find expression.

P.S. I’m going to bed now — it’s too late in my time zone — so I’ll be unable to answer your further question quickly.

P.P.S If you happen to be interested in those PowerFind Pro expressions, try http://www.regular-expressions.info/tutorial.html, which is the best tutorial of regular expression as far as I know.
Post Reply