Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.013 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'algorithm': 0.04; 'languages.': 0.04; 'subject:Python': 0.06; 'builtin': 0.09; 'spelled': 0.09; 'subject:module': 0.09; 'compares': 0.16; 'dependent.': 0.16; 'expressions,': 0.16; 'fingerprints': 0.16; 'fuzzy': 0.16; 'variants': 0.16; 'language': 0.16; 'wrote:': 0.18; 'trying': 0.19; "python's": 0.19; 'to:name:python- list@python.org': 0.22; 'algorithms.': 0.24; 'subject:problem': 0.24; 'purposes': 0.26; 'function': 0.29; 'michael': 0.29; 'am,': 0.29; 'words': 0.29; 'matching': 0.30; 'newer': 0.30; 'url:wiki': 0.31; 'names.': 0.31; 'url:wikipedia': 0.31; 'supposed': 0.32; 'regular': 0.32; 'quite': 0.32; 'problem': 0.35; 'but': 0.35; 'there': 0.35; 'module.': 0.36; 'charset:us-ascii': 0.36; 'similar': 0.36; 'url:org': 0.36; 'received:10': 0.37; 'problems': 0.38; 'to:addr:python-list': 0.38; 'rather': 0.38; 'to:addr:python.org': 0.39; 'either': 0.39; 'called': 0.40; 'even': 0.60; 'skip:u 10': 0.60; 'solve': 0.60; 'most': 0.60; 'ago,': 0.61; 'such': 0.63; 'note:': 0.66; 'side': 0.67; 'computers': 0.72; 'approach.': 0.91; 'differences': 0.93 From: Nick Cash To: "python-list@python.org" Subject: Re: Python's re module and genealogy problem Thread-Topic: Python's re module and genealogy problem Thread-Index: AQHPhXAxUFlIAqbajESen6U4Sp09uQ== Date: Wed, 11 Jun 2014 16:21:18 +0000 References: <53987720.4020406@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [70.166.238.194] x-microsoft-antispam: BL:0; ACTION:Default; RISK:Low; SCL:0; SPMLVL:NotSpam; PCL:0; RULEID: x-forefront-prvs: 0239D46DB6 x-forefront-antispam-report: SFV:NSPM; SFS:(6009001)(428001)(189002)(199002)(377454003)(479174003)(24454002)(51704005)(76576001)(101416001)(80022001)(4396001)(86362001)(66066001)(77096999)(81342001)(15975445006)(99396002)(99286001)(79102001)(50986999)(74316001)(83072002)(19580395003)(83322001)(76482001)(87936001)(74502001)(76176999)(21056001)(20776003)(85852003)(54356999)(15202345003)(77982001)(33646001)(92566001)(46102001)(64706001)(81542001)(74662001)(31966008)(2656002)(24736002); DIR:OUT; SFP:; SCL:1; SRVR:DM2PR06MB541; H:DM2PR06MB542.namprd06.prod.outlook.com; FPR:; MLV:sfv; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (: npcinternational.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=nick.cash@npcinternational.com; Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: npcinternational.com X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 27 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1402504629 news.xs4all.nl 2841 [2001:888:2000:d::a6]:54342 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:73180 =0A= On 06/11/2014 10:35 AM, Michael Torrie wrote:=0A= > On 06/11/2014 06:23 AM, BrJohan wrote:=0A= >> For some genealogical purposes I consider using Python's re module.=0A= >>=0A= >> Rather many names can be spelled in a number of similar ways, and in =0A= >> order to match names even if they are spelled differently, I will build = =0A= >> regular expressions, each of which is supposed to match a number of =0A= >> similar names.=0A= > You might want to search for fuzzy matching algorithms. Years ago, there= =0A= > was an algorithm called soundex that would generate fuzzy fingerprints=0A= > for words that would hide differences in spelling, etc. Unfortunately=0A= > such an algorithm would be language dependent. The problem you are=0A= > trying to solve is one of those very hard problems in computers and math.= =0A= >=0A= =0A= Soundex is actually not horrible, but it is definitely only for English=0A= names. Newer variants of Metaphone=0A= (http://en.wikipedia.org/wiki/Metaphone) are significantly better, and=0A= support quite a few other languages. Either one would most likely be=0A= better than the regex approach.=0A= =0A= Side note: if your data happens to be in MySQL then it has a builtin=0A= "sounds_like()" function that compares strings using soundex.=0A=