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

GenoPro Support Forum




Universal HTML Report Generator

Click to view RSS...
Author The report templates should try to avoid localised issues and bring out a report in a universal style.
Posted Thursday, August 18, 2005 - Post #6869
Legendary Master

Legendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary Master

Administrators
Moderators
Customers
Gamma
FamilyTrees.GenoPro.com
Translator
GenoPro version: 3.1.0.1

Last Login: 1 hour ago
Posts: 4,886, Visits: 22,776
When the last letter is a noun (except s), add suffix "in"

How to determine if a word is a noun. Is there a dictionary or a set of keywords. GenoPro can have a dictionary entry with the follwing code:
<Nouns>
<Noun>Tom</Noun>
<Noun>Aslak</Noun>
<Noun>Jasmin</Noun>
...
</Nouns>

but that would be too long. Is there a pattern to recognize a noun?


Edited: Thursday, December 22, 2005 by GenoProSupport
Posted Thursday, August 18, 2005 - Post #6870
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Forum Members

Last Login: Wednesday, August 17, 2005
Posts: 24, Visits: 0
:oops: Had wrong English word on my post. It's now corrected.
Posted Thursday, August 18, 2005 - Post #6871
Legendary Master

Legendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary Master

Administrators
Moderators
Customers
Gamma
FamilyTrees.GenoPro.com
Translator
GenoPro version: 3.1.0.1

Last Login: 1 hour ago
Posts: 4,886, Visits: 22,776
Thanks for editing your post. I will delete my post too...
Posted Thursday, August 18, 2005 - Post #6872
Forum Master

Forum MasterForum MasterForum MasterForum MasterForum MasterForum MasterForum MasterForum MasterForum Master

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

Last Login: Sunday, March 21, 2021
Posts: 716, Visits: 12,927
There should also space beeing provided for information about place of living/residence or whatever you will name those places somebody has lived during his lifetime. Since we do not have details yet about these fields I think we have to wait until one of the last Beta versions.
Posted Thursday, August 18, 2005 - Post #6873
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Forum Members

Last Login: Wednesday, August 17, 2005
Posts: 24, Visits: 0
Howdy. Here's a sample javascript that my brother Sami wrote to handle finnish possessive suffixes with the exceptions discussed above.
Dan spoke about a routine so I hope this is any help in implementing such routine.



<script language="JavaScript" type="text/javascript">
<!--

nimet = new Array ("Rami", "Toni", "Risto", "Marika", "Tom", "Aslak", "Jasmin", "Mikael", "Abraham", "Elisabet", "Armas", "Iiris", "Joonas", "Markus", "Johannes", "Eppu", "Pekka", "Titta", "Seppo", "Tuukka", "Riitta", "Jukkapekka", "Markku-Pekka", "Ilmatar", "Suometar");

for (i = 0; i < nimet.length; i++) {

nimi = nimet[i];
document.write (nimi + ' --> ');

// Exception 1
if (nimi.match(/[bcdfghjklmnpqrtvwxyz]$/) != null && nimi.match(/tar$/) == null) nimi = nimi + 'i';

// Exception 2
nimi = nimi.replace(/s$/, 'kse');

// Exception 3
nimi = nimi.replace(/kk.$/, 'k' + nimi.substring(nimi.length - 1, nimi.length));
nimi = nimi.replace(/pp.$/, 'p' + nimi.substring(nimi.length - 1, nimi.length));
nimi = nimi.replace(/tt.$/, 't' + nimi.substring(nimi.length - 1, nimi.length));

// Exception 4
nimi = nimi.replace(/tar$/, 'ttare');

nimi = nimi + 'n';
document.write (nimi + '<br>');

}

//-->
</script>


Edited: Thursday, December 22, 2005 by GenoProSupport
Posted Thursday, August 18, 2005 - Post #6874
Legendary Master

Legendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary Master

Administrators
Moderators
Customers
Gamma
FamilyTrees.GenoPro.com
Translator
GenoPro version: 3.1.0.1

Last Login: 1 hour ago
Posts: 4,886, Visits: 22,776
Thanks for your contribution. A sample code is always a great value.
Posted Thursday, August 18, 2005 - Post #6875
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Forum Members

Last Login: Wednesday, August 17, 2005
Posts: 24, Visits: 0
Misplaced this message earlier, sorry, I moved it here where it belonged.

Dear Dan,

My brother and I are looking into the "relative and possessive pronouns and suffixes in Finnish" issue here. He is specialized in javascript and already found a way how to apply proper suffixes in js. However, we don't know how to put them into use with the Report generator. We found that in beta build j you have file code\lang.vbs which includes something similar ('s or s). Now, my question is:
Can we add these javascripts directly somehow, or must we modify the script in lang.vbs to do the trick or what? For future it would also be nice to know is it worthwhile to write javascript if you fancy vbs more and eventually have to re-write everything in vbs.
Posted Thursday, August 18, 2005 - Post #6876
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Forum Members

Last Login: Wednesday, August 17, 2005
Posts: 24, Visits: 0
Tonight I did a little self-learning research on your lang.vbs and by trial and error I managed to implement two of the needed exceptions myself. 8) Here's a sample of the code which I modified from yours:

' Finnish possessive suffixes
Function StrPossessiveProperNoun(name)
if right(name,1) = "s" then
StrPossessiveProperNoun=Replace(name,"s","kse") & "n"
else if right(name,1) <> "a" and right(name,1) <> "e" and right(name,1) <> "i" and right(name,1) <> "o" and right(name,1) <> "u" and right(name,1) <> "y" and right(name,1) <> "ä" and right(name,1) <> "ö" then
StrPossessiveProperNoun=name & "in"
else
StrPossessiveProperNoun=name & "n"
end if
end if
End Function


A problem can occur in case where there's multiple s letters although I cannot think of any such name. I know there's a way to solve this by counting the letters in a name and using this to determine the place of last letter in order to replace only this one but I couldn't figure out how.

Replace function must work also in double consonant cases "Pekka --> Pekan", "Eppu --> Epun", "Titta --> Titan", but I couldn't think of proper condition nor a way to replace only the latter double consonant in a name such as "Jari-Jukka --> Jari-Jukan".

Also, I found another exception which I think is with surnames only: Possessive structures "Nieminen --> Niemisen", "Kukkonen --> Kukkosen" are needed as well. (How I bumped into this problem in the first place was that I had a individual without first name in my tree and it said "Pääkkönenin" instead of the right form "Pääkkösen" in the report.)


Edited: Thursday, December 22, 2005 by GenoProSupport
Posted Thursday, August 18, 2005 - Post #6877
Legendary Master

Legendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary Master

Administrators
Moderators
Customers
Gamma
FamilyTrees.GenoPro.com
Translator
GenoPro version: 3.1.0.1

Last Login: 1 hour ago
Posts: 4,886, Visits: 22,776
Thanks for your suggestion and code contribution.

I modified the report engine to fully support JavaScript code. I have generated reports using the sample report template at http://www.genopro.com/beta/JavaScriptReport.zip. You will have to wait for Beta14 (this month) to run the scripts in JavaScript.

I personally find JavaScript more powerful than VBScript because of the return statement for functions, and break and continue for loops. In the future, I plan to favor JavaScript over VBScript. New report templates will likely be written in JavaScript only. I will run a poll to ask users if they prefer to write code in VBScript or JavaScript.
Posted Thursday, August 18, 2005 - Post #6878
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Forum Members

Last Login: Wednesday, August 17, 2005
Posts: 24, Visits: 0
Cool, thanks. And glad to help.

I experienced a problem running the Javascript skin.
Report log:

Generating report to 'J:\Sukupuut\GenoPro Reportsorrvik\'
Cloning document NORRVIK...
Opening configuration file Config.xml for skin '\JavaScript - JavaScript Testing'...
Loading dictionary.xml...
Processing template 'init.htm'...
Error at line 21 (init.htm) : Expected ';'
Microsoft JScript compilation error 800A03EC
Report.WriteTemplate 0,1666


Line 21 is the line with the following text: <%[

What's wrong?
Does this work ok on your computer?


Similar Topics

Click to view RSS...
Expand / Collapse

Reading This Topic

Expand / Collapse
Active: 3 - 1 guest, 1 member, 0 anonymous.
Refresh