GenoPro Home
GenoPro Home  |  Get Started With My Genealogy Tree  |  Buy  |  Login  |  Privacy  |  Search  |  Site Map
 

GenoPro Support Forum




PossessiveProperNoun

Click to view RSS...
Author Trouble with regular expression
Posted Wednesday, May 7, 2008 - Post #21610
Famous Writer

Famous WriterFamous WriterFamous WriterFamous WriterFamous WriterFamous WriterFamous WriterFamous WriterFamous Writer

Customers
FamilyTrees.GenoPro.com
GenoPro version: 3.1.0.1

Last Login: Sunday, January 29, 2023
Posts: 439, Visits: 2,937
The rule I'm trying to define is as follows: If the last character is an "s", "x" or "z" then use the value as is else append an "s".  E.g., Alice should become Alices, like in "Alices vader" and Charles should remain unchanged like in "Charles vader".

The original (EN) code is: <PossessiveProperNoun T="(s$)=$1'Sad.$)=$1's:" /> which returns Alices and Charles'.  But I wanted to get rid of the terminating apostroph.

I've tried following combinations but they don't deliver the expected result.

T="([sxz]$)=$1Sad[^sxz])=$1s:"               returns Aslice and Csharles
T="([sxz]$)=$1Sad.$)=$1s:"                      returns Alices (OK)  and Charless
T="(s$)=$1Sadx$)=$1Sadz$)=$1Sad.$)=$1s:" returns Alices (OK)  and Charless

Can anybody tell me what I'm doing wrong?

PS: I was unable to use script56.chm as documented but found information at http://msdn.microsoft.com/en-us/library/6wzad2b2.aspx

Posted Thursday, May 8, 2008 - Post #21611
Famous Writer

Famous WriterFamous WriterFamous WriterFamous WriterFamous WriterFamous WriterFamous WriterFamous WriterFamous Writer

Important Contributors
FamilyTrees.GenoPro.com
Customers
Translator
GenoPro version: 2.0.1.6

Last Login: Tuesday, December 16, 2008
Posts: 390, Visits: 1,271
Try:

<PossessiveProperNoun T="([^ sxz]$)=$1s:" />

This code means: if not (the '^') ending (the '$') with s, x or z, append an 's' at the end.

I tried it with my tree and it looks OK.

JC

Update: the script56.chm file can be downloaded at MS:

http://www.microsoft.com/downloads/details.aspx?FamilyId=01592C48-207D-4BE1-8A76-1C4099D7BBB9&displaylang=en

Edited: Thursday, May 8, 2008 by jcguasp

Posted Thursday, May 8, 2008 - Post #21612
Famous Writer

Famous WriterFamous WriterFamous WriterFamous WriterFamous WriterFamous WriterFamous WriterFamous WriterFamous Writer

Customers
FamilyTrees.GenoPro.com
GenoPro version: 3.1.0.1

Last Login: Sunday, January 29, 2023
Posts: 439, Visits: 2,937
Thanks JC,  your suggestion works.

Turns out that I forgot the "$" after "[^sxz]".  That's the sort of error you don't see when you wrote it yourself.



Similar Topics

Click to view RSS...
Expand / Collapse

Reading This Topic

Expand / Collapse