2007-10-16 Frederik De Richter <frederik.de.richter@googlemail.com>
* src/plugins/rel_nl.py: new version svn: r9196
This commit is contained in:
parent
f9606c4b03
commit
bd5512f31f
@ -1,3 +1,6 @@
|
||||
2007-10-16 Frederik De Richter <frederik.de.richter@googlemail.com>
|
||||
* src/plugins/rel_nl.py: new version
|
||||
|
||||
2007-10-15 Douglas S. Blank <dblank@cs.brynmawr.edu>
|
||||
* src/plugins/WebCal.py: fixed a wrong indent level
|
||||
* src/plugins/Calendar.py: handle divorces, weekdays, easter, eval values in XML
|
||||
|
@ -39,84 +39,182 @@ from PluginUtils import register_relcalc
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
_level_name = [ "",
|
||||
"eerste",
|
||||
"tweede",
|
||||
"derde",
|
||||
"vierde",
|
||||
"vijfde",
|
||||
"zesde",
|
||||
"zevende",
|
||||
"achtste",
|
||||
"negende",
|
||||
"tiende",
|
||||
"elfde",
|
||||
"twaalfde",
|
||||
"dertiende",
|
||||
"veertiende",
|
||||
"vijftiende",
|
||||
"zestiende",
|
||||
"zeventiende",
|
||||
"acttiende",
|
||||
"negentiende",
|
||||
"twintigste",
|
||||
"eenentwintigste",
|
||||
"tweeëntwintigste",
|
||||
"drieëntwingste",
|
||||
"vierentwingste",
|
||||
"vijfentwintigste",
|
||||
"zesentwintigste",
|
||||
"zevenentwintigste",
|
||||
"achtentwintigste",
|
||||
"negenentwintigste",
|
||||
"dertigste" ]
|
||||
_removed_level = [ " ",
|
||||
" eerste graad",
|
||||
" tweede graad",
|
||||
" derde graad",
|
||||
" vierde graad",
|
||||
" vijfde graad",
|
||||
" zesde graad",
|
||||
" zevende graad",
|
||||
" achtste",
|
||||
" negende",
|
||||
" tiende",
|
||||
" elfde",
|
||||
" twaalfde",
|
||||
" dertiende",
|
||||
" veertiende",
|
||||
" vijftiende",
|
||||
" zestiende",
|
||||
" zeventiende",
|
||||
" achttiende",
|
||||
" negentiende",
|
||||
" twintigste",
|
||||
" eenentwintigste",
|
||||
" tweeëntwintigste",
|
||||
" drieëntwingste",
|
||||
" vierentwingste",
|
||||
" vijfentwintigste",
|
||||
" zesentwintigste",
|
||||
" zevenentwintigste",
|
||||
" achtentwintigste",
|
||||
" negenentwintigste",
|
||||
" dertigste" ]
|
||||
|
||||
_parents_level = [ "",
|
||||
"ouders",
|
||||
"grootouders",
|
||||
"overgrootouders",
|
||||
"betovergrootouders", ]
|
||||
"betovergrootouders",
|
||||
"oudouders",
|
||||
"oudgrootouders",
|
||||
"oudovergrootouders",
|
||||
"oudbetovergrootouders",
|
||||
"stamouders",
|
||||
"stamgrootouders",
|
||||
"stamovergrootouders",
|
||||
"stambetovergrootouders",
|
||||
"stamoudouders",
|
||||
"stamoudgrootouders",
|
||||
"stamoudovergrootouders",
|
||||
"stamoudbetovergrootouders",
|
||||
"edelouders",
|
||||
"edelgrootoders",
|
||||
"edelovergrootoudouders",
|
||||
"edelbetovergrootouders",
|
||||
"edeloudouders",
|
||||
"edeloudgrootouders",
|
||||
"edeloudvergrootouders",
|
||||
"edeloudbetovergrootouders",
|
||||
"edelstamouders",
|
||||
"edelstamgrootouders",
|
||||
"edelstamovergrootouders",
|
||||
"edelstambetovergrootouders",
|
||||
"edelstamoudouders" ]
|
||||
|
||||
_father_level = [ "",
|
||||
"vader",
|
||||
"grootvader",
|
||||
"overgrootvader",
|
||||
"betovergrootvader", ]
|
||||
"vader (graad 1)",
|
||||
"grootvader (graad 2)",
|
||||
"overgrootvader (graad 3)",
|
||||
"betovergrootvader (graad 4)",
|
||||
"oudvader (graad 5)",
|
||||
"oudgrootvader (graad 6)",
|
||||
"oudovergrootvader(graad 7)",
|
||||
"oudbetovergrootvader (graad 8)",
|
||||
"stamvader graad 9)",
|
||||
"stamgrootvader",
|
||||
"stamovergrootvader",
|
||||
"stambetovergrootvader",
|
||||
"stamoudvader",
|
||||
"stamoudgrootvader",
|
||||
"stamoudovergrootvader",
|
||||
"stamoudbetovergrootvader",
|
||||
"edelvader",
|
||||
"edelgrootvader",
|
||||
"edelovergrootoudvader",
|
||||
"edelbetovergrootvader",
|
||||
"edeloudvader",
|
||||
"edeloudgrootvader",
|
||||
"edeloudvergrootvader",
|
||||
"edeloudbetovergrootvader",
|
||||
"edelstamvader",
|
||||
"edelstamgrootvader",
|
||||
"edelstamovergrootvader",
|
||||
"edelstambetovergrootvader",
|
||||
"edelstamoudvader" ]
|
||||
|
||||
_mother_level = [ "",
|
||||
"moeder",
|
||||
"grootmoeder",
|
||||
"overgrootmoeder",
|
||||
"betovergrootmoeder", ]
|
||||
"moeder (graad 1)",
|
||||
"grootmoeder (graad 2)",
|
||||
"overgrootmoeder (graad 3)",
|
||||
"betovergrootmoeder (graad 4)",
|
||||
"oudmoeder",
|
||||
"oudgrootmoeder",
|
||||
"oudovergrootmoeder",
|
||||
"oudbetovergrootmoeder",
|
||||
"stammoeder",
|
||||
"stamgrootmoeder",
|
||||
"stamovergrootmoeder",
|
||||
"stambetovergrootmoeder",
|
||||
"stamoudmoeder",
|
||||
"stamoudgrootmoeder",
|
||||
"stamoudovergrootmoeder",
|
||||
"stamoudbetovergrootmoeder",
|
||||
"edelmoeder",
|
||||
"edelgrootmoeder",
|
||||
"edelovergrootoudmoeder",
|
||||
"edelbetovergrootmoeder",
|
||||
"edeloudmoeder",
|
||||
"edeloudgrootmoeder",
|
||||
"edeloudvergrootmoeder",
|
||||
"edeloudbetovergrootmoeder",
|
||||
"edelstammoeder",
|
||||
"edelstamgrootmoeder",
|
||||
"edelstamovergrootmoeder",
|
||||
"edelstambetovergrootmoeder",
|
||||
"edelstamoudmoeder" ]
|
||||
|
||||
_son_level = [ "",
|
||||
"zoon",
|
||||
"kleinzoon",
|
||||
"achterkleinzoon", ]
|
||||
"achterkleinzoon",
|
||||
"achterachterkleinzoon",
|
||||
"achterachterachterkleinzoon"]
|
||||
|
||||
_daughter_level = [ "",
|
||||
"dochter",
|
||||
"kleindochter",
|
||||
"achterkleindochter", ]
|
||||
"achterkleindochter",
|
||||
"achterachterkleindochter",
|
||||
"achterachterachterkleindochter"]
|
||||
|
||||
_sister_level = [ "",
|
||||
"zuster",
|
||||
"tante",
|
||||
"groottante", ]
|
||||
##_sister_level = [ "",
|
||||
## "zuster",
|
||||
## "tante",
|
||||
## "groottante",
|
||||
## "overgroottante" ,
|
||||
## "betovergroottante",
|
||||
## "oudtante"]
|
||||
|
||||
_brother_level = [ "",
|
||||
"broer",
|
||||
"oom",
|
||||
"grootoom", ]
|
||||
##_brother_level = [ "",
|
||||
## "broer",
|
||||
## "oom",
|
||||
## "grootoom",
|
||||
## "overgrootoom",
|
||||
## "betovergrootoom",
|
||||
## "oudoom" ]
|
||||
|
||||
_nephew_level = [ "",
|
||||
"neef",
|
||||
"achterneef", ]
|
||||
"achterneef",
|
||||
"achterachterneef" ]
|
||||
|
||||
_niece_level = [ "",
|
||||
"nicht",
|
||||
"achternicht", ]
|
||||
"achternicht",
|
||||
"achterachtenicht"]
|
||||
_aunt_level = [ "",
|
||||
"tante",
|
||||
"groottante",
|
||||
"overgroottante",
|
||||
"betovergroottante",
|
||||
"oudtante"]
|
||||
|
||||
_uncle_level = [ "",
|
||||
"oom",
|
||||
"grootoom",
|
||||
"overgrootoom",
|
||||
"betovergrootoom"]
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
#
|
||||
@ -127,31 +225,18 @@ class RelationshipCalculator(Relationship.RelationshipCalculator):
|
||||
def __init__(self):
|
||||
Relationship.RelationshipCalculator.__init__(self)
|
||||
|
||||
def get_male_cousin(self,level):
|
||||
if level>len(_level_name)-1:
|
||||
return "le parent lointain"
|
||||
else:
|
||||
return "neef in de %s graad" % (_level_name[level])
|
||||
|
||||
def get_female_cousin(self,level):
|
||||
if level>len(_level_name)-1:
|
||||
return "la parente lointaine"
|
||||
else:
|
||||
return "nicht in de %s graad" % (_level_name[level])
|
||||
|
||||
def get_parents(self,level):
|
||||
def get_parents(self, level):
|
||||
if level>len(_parents_level)-1:
|
||||
return "verre voorouders"
|
||||
else:
|
||||
return _parents_level[level]
|
||||
|
||||
def get_father(self,level):
|
||||
def get_father(self, level):
|
||||
if level>len(_father_level)-1:
|
||||
return "verre voorouder"
|
||||
else:
|
||||
return _father_level[level]
|
||||
|
||||
def get_son(self,level):
|
||||
def get_son(self, level):
|
||||
if level>len(_son_level)-1:
|
||||
return "verre afstammeling"
|
||||
else:
|
||||
@ -163,59 +248,73 @@ class RelationshipCalculator(Relationship.RelationshipCalculator):
|
||||
else:
|
||||
return _mother_level[level]
|
||||
|
||||
def get_daughter(self,level):
|
||||
def get_daughter(self, level):
|
||||
if level>len(_daughter_level)-1:
|
||||
return "verre afstammelinge"
|
||||
else:
|
||||
return _daughter_level[level]
|
||||
|
||||
def get_aunt(self,level):
|
||||
if level>len(_sister_level)-1:
|
||||
def get_aunt(self, level, removed):
|
||||
if level>len(_aunt_level)-1 or removed > len(_removed_level) -1:
|
||||
return "verre voorouder"
|
||||
else:
|
||||
return _sister_level[level]
|
||||
|
||||
def get_uncle(self,level):
|
||||
if level>len(_brother_level)-1:
|
||||
return _aunt_level[level] + _removed_level[removed]
|
||||
def get_uncle(self, level, removed):
|
||||
if level>len(_uncle_level)-1 or removed > len(_removed_level) -1:
|
||||
return "verre voorouder"
|
||||
else:
|
||||
return _brother_level[level]
|
||||
return _uncle_level[level] + _removed_level[removed]
|
||||
|
||||
def get_nephew(self,level):
|
||||
if level>len(_nephew_level)-1:
|
||||
return "verre afstammelling"
|
||||
def get_nephew(self,level, removed):
|
||||
if level>len(_nephew_level)-1 or removed > len(_removed_level) -1:
|
||||
return "verre voorouder"
|
||||
else:
|
||||
return _nephew_level[level]
|
||||
return _nephew_level[level] + _removed_level[removed]
|
||||
|
||||
def get_niece(self,level):
|
||||
if level>len(_niece_level)-1:
|
||||
def get_niece(self,level, removed):
|
||||
if level>len(_niece_level)-1 or removed > len(_removed_level) -1:
|
||||
return "verre afstammelinge"
|
||||
else:
|
||||
return _niece_level[level]
|
||||
return _niece_level[level] + _removed_level[removed]
|
||||
|
||||
def get_relationship(self,db,orig_person,other_person):
|
||||
def get_male_cousin(self,removed):
|
||||
if removed>len(_removed_level)-1:
|
||||
return "verre afstammeling"
|
||||
elif removed == 0:
|
||||
return "broer"
|
||||
else:
|
||||
return "neef "+_removed_level[removed]
|
||||
|
||||
def get_female_cousin(self,removed):
|
||||
if removed>len(_removed_level)-1:
|
||||
return "verre afstammelinge"
|
||||
elif removed == 0:
|
||||
return " zus"
|
||||
else:
|
||||
return "nicht "+ _removed_level[removed]
|
||||
|
||||
def get_relationship(self, db, orig_person, other_person):
|
||||
"""
|
||||
Returns a string representing the relationshp between the two people,
|
||||
along with a list of common ancestors (typically father,mother)
|
||||
|
||||
Special cases: relation strings "", "undefined" and "spouse".
|
||||
"""
|
||||
|
||||
if orig_person == None:
|
||||
return ("niet bepaalde",[])
|
||||
return ("niet bepaald",[])
|
||||
|
||||
if orig_person.get_handle() == other_person.get_handle():
|
||||
return ('', [])
|
||||
|
||||
is_spouse = self.is_spouse(db,orig_person,other_person)
|
||||
is_spouse = self.is_spouse(db, orig_person, other_person)
|
||||
if is_spouse:
|
||||
return (is_spouse,[])
|
||||
|
||||
(firstRel,secondRel,common) = \
|
||||
self.get_relationship_distance(db,orig_person,other_person)
|
||||
(firstRel,secondRel,common) = self.get_relationship_distance(db,
|
||||
orig_person,other_person)
|
||||
|
||||
if type(common) == types.StringType or \
|
||||
type(common) == types.UnicodeType:
|
||||
if (type(common) == types.StringType or
|
||||
type(common) == types.UnicodeType):
|
||||
return (common,[])
|
||||
elif common:
|
||||
person_handle = common[0]
|
||||
@ -229,50 +328,55 @@ class RelationshipCalculator(Relationship.RelationshipCalculator):
|
||||
if secondRel == 0:
|
||||
return ('',common)
|
||||
elif other_person.get_gender() == gen.lib.Person.MALE:
|
||||
return (self.get_father(secondRel),common)
|
||||
return (self.get_father(secondRel), common)
|
||||
else:
|
||||
return (self.get_mother(secondRel),common)
|
||||
return (self.get_mother(secondRel), common)
|
||||
elif secondRel == 0:
|
||||
if other_person.get_gender() == gen.lib.Person.MALE:
|
||||
return (self.get_son(firstRel),common)
|
||||
return (self.get_son(firstRel), common)
|
||||
else:
|
||||
return (self.get_daughter(firstRel),common)
|
||||
elif firstRel == 1:
|
||||
return (self.get_daughter(firstRel), common)
|
||||
elif secondRel > firstRel:
|
||||
if other_person.get_gender() == gen.lib.Person.MALE:
|
||||
return (self.get_uncle(secondRel),common)
|
||||
return (self.get_uncle(secondRel - firstRel,firstRel), common)
|
||||
else:
|
||||
return (self.get_aunt(secondRel),common)
|
||||
elif secondRel == 1:
|
||||
return (self.get_aunt(secondRel - firstRel, firstRel), common)
|
||||
elif secondRel < firstRel:
|
||||
if other_person.get_gender() == gen.lib.Person.MALE:
|
||||
return (self.get_nephew(firstRel-1),common)
|
||||
return (self.get_nephew(firstRel - secondRel, secondRel), common)
|
||||
else:
|
||||
return (self.get_niece(firstRel-1),common)
|
||||
elif firstRel == 2 and secondRel == 2:
|
||||
if other_person.get_gender() == gen.lib.Person.MALE:
|
||||
return ('le cousin germain',common)
|
||||
else:
|
||||
return ('la cousine germaine',common)
|
||||
elif firstRel == 3 and secondRel == 2:
|
||||
if other_person.get_gender() == gen.lib.Person.MALE:
|
||||
return ('le neveu à la mode de Bretagne',common)
|
||||
else:
|
||||
return ('la nièce à la mode de Bretagne',common)
|
||||
elif firstRel == 2 and secondRel == 3:
|
||||
if other_person.get_gender() == gen.lib.Person.MALE:
|
||||
return ('l\'oncle à la mode de Bretagne',common)
|
||||
else:
|
||||
return ('la tante à la mode de Bretagne',common)
|
||||
return (self.get_niece(firstRel - secondRel, secondRel), common)
|
||||
else:
|
||||
if other_person.get_gender() == gen.lib.Person.MALE:
|
||||
if firstRel+secondRel>len(_level_name)-1:
|
||||
return (self.get_male_cousin(firstRel+secondRel),common)
|
||||
if other_person.get_gender() == gen.lib.Person.MALE:
|
||||
return (self.get_male_cousin(firstRel -1), common)
|
||||
else:
|
||||
return ('verre neef',common)
|
||||
else:
|
||||
if firstRel+secondRel>len(_level_name)-1:
|
||||
return (self.get_female_cousin(firstRel+secondRel),common)
|
||||
else:
|
||||
return ('verre nicht',common)
|
||||
return (self.get_female_cousin(firstRel -1), common)
|
||||
## elif firstRel == 2 and secondRel == 2:
|
||||
## if other_person.get_gender() == gen.lib.Person.MALE:
|
||||
## return ('de neef',common)
|
||||
## else:
|
||||
## return ('de nicht',common)
|
||||
## elif firstRel == 3 and secondRel == 2:
|
||||
## if other_person.get_gender() == gen.lib.Person.MALE:
|
||||
## return ('neef',common)
|
||||
## else:
|
||||
## return ('nicht',common)
|
||||
## elif firstRel == 2 and secondRel == 3:
|
||||
## if other_person.get_gender() == gen.lib.Person.MALE:
|
||||
## return ('de oom',common)
|
||||
## else:
|
||||
## return ('de tante',common)
|
||||
## else:
|
||||
## if other_person.get_gender() == gen.lib.Person.MALE:
|
||||
## if firstRel+secondRel>len(_level_name)-1:
|
||||
## return (self.get_male_cousin(firstRel+secondRel),common)
|
||||
## else:
|
||||
## return ('verre neef',common)
|
||||
## else:
|
||||
## if firstRel+secondRel>len(_level_name)-1:
|
||||
## return (self.get_female_cousin(firstRel+secondRel),common)
|
||||
## else:
|
||||
## return ('verre nicht',common)
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -280,5 +384,7 @@ class RelationshipCalculator(Relationship.RelationshipCalculator):
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
register_relcalc(RelationshipCalculator,
|
||||
["nl", "NL", "nl_NL", "nl_BE", "nederlands", "Nederlands", "nl_NL.UTF8", "nl_BE.UTF8","nl_NL@euro", "nl_NL.UTF8@euro","nl_BE@euro",
|
||||
"dutch","Dutch", "nl_NL.UTF-8", "nl_BE.UTF-8","nl_NL.utf-8", "nl_BE.utf-8","nl_NL.utf8", "nl_BE.UTF-8", "nl_BE.UTF8@euro"])
|
||||
["nl", "NL", "nl_NL", "nl_BE", "nederlands", "Nederlands", "nl_NL.UTF8",
|
||||
"nl_BE.UTF8","nl_NL@euro", "nl_NL.UTF8@euro","nl_BE@euro",
|
||||
"dutch","Dutch", "nl_NL.UTF-8", "nl_BE.UTF-8","nl_NL.utf-8",
|
||||
"nl_BE.utf-8","nl_NL.utf8", "nl_BE.UTF-8", "nl_BE.UTF8@euro"])
|
||||
|
Loading…
x
Reference in New Issue
Block a user