* src/plugins/Merge.py (gen_key,name_compare):

Fall back to not using soundex if the charset can't be latin-1 encoded.


svn: r2778
This commit is contained in:
Alex Roitman 2004-02-05 19:37:58 +00:00
parent 154b7ef6f4
commit 78fc879948
2 changed files with 15 additions and 3 deletions

View File

@ -1,3 +1,7 @@
2004-02-05 Alex Roitman <shura@alex.neuro.umn.edu>
* src/plugins/Merge.py (gen_key,name_compare):
Fall back to not using soundex if the charset can't be latin-1 encoded.
2004-02-05 Michel Guitel <michel.guitel@free.fr>
* doc/gramps-manual/fr/cmdline.xml: Update.
* doc/gramps-manual/fr/filtref.xml: Update.

View File

@ -1,7 +1,7 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000 Donald N. Allingham
# Copyright (C) 2000-2004 Donald N. Allingham
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -18,6 +18,8 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# $Id$
"Database Processing/Merge people"
#-------------------------------------------------------------------------
@ -292,13 +294,19 @@ class Merge:
def gen_key(self,val):
if self.use_soundex:
try:
return soundex.soundex(val)
except UnicodeEncodeError:
return val
else:
return val
def name_compare(self,s1,s2):
if self.use_soundex:
try:
return soundex.compare(s1,s2)
except UnicodeEncodeError:
return s1 == s2
else:
return s1 == s2