Re: regex string matching python3

2018-10-01 Thread Brian J. Oney via Python-list
On Mon, 2018-10-01 at 10:49 -0700, nanman3...@gmail.com wrote: > I have a string like this:  >  > b'\tC:94.3%[S:89.9%,D:4.4%],F:1.7%,M:4.0%,n:1440\n' >  > And I would like to  extract the numbers corresponding to S,D,F and M in this > string and convert them into an array like this:  >  > [ '89.9'

Re: regex string matching python3

2018-10-01 Thread MRAB
On 2018-10-01 18:49, nanman3...@gmail.com wrote: I have a string like this: b'\tC:94.3%[S:89.9%,D:4.4%],F:1.7%,M:4.0%,n:1440\n' And I would like to extract the numbers corresponding to S,D,F and M in this string and convert them into an array like this: [ '89.9', '4.4', '1.7', '4.0'] Any he

regex string matching python3

2018-10-01 Thread nanman3012
I have a string like this: b'\tC:94.3%[S:89.9%,D:4.4%],F:1.7%,M:4.0%,n:1440\n' And I would like to extract the numbers corresponding to S,D,F and M in this string and convert them into an array like this: [ '89.9', '4.4', '1.7', '4.0'] Any help would be appreciated! -- https://mail.python

Re: String matching based on sound?

2018-01-29 Thread Steven D'Aprano
On Mon, 29 Jan 2018 13:28:32 -0900, Israel Brewster wrote: > In initial searching, I did find the "fuzzy" library, which at first > glance appeared to be what I was looking for, but it, apparently, > ignores numbers, with the result that "all 4 one" gave the same output > as "all in", but NOT the

String matching based on sound?

2018-01-29 Thread Israel Brewster
I am working on a python program that, at one step, takes an input (string), and matches it to songs/artists in a users library. I'm having some difficulty, however, figuring out how to match when the input/library contains numbers/special characters. For example, take the group "All-4-One". In

String Matching

2006-03-31 Thread david brochu jr
Hello,   I am trying to write a script that takes strings from a text file and searches to see if they are present in another text file...here is the code:   import osimport re search = open("c:\python24\scripts\pii\expected_rules_results.txt") def find(x): file = open("c:\python24\scripts\pii\dav

Re: Aproximative string matching

2005-11-21 Thread Irmen de Jong
javuchi wrote: > I'm searching for a library which makes aproximative string matching, > for example, searching in a dictionary the word "motorcycle", but > returns similar strings like "motorcicle". > > Is there such a library? > Perhaps the get_clo

Re: Aproximative string matching

2005-11-21 Thread Steven D'Aprano
On Mon, 21 Nov 2005 19:47:45 +0100, Diez B. Roggisch wrote: > The idea is that otherwise e.g. "cat" and "hippopothamus" have a > l-distance of only 3, which one would consider good at the first look. ??? I make it that the L-distance between cat and hippopothamus is twelve, not three. With len(

Re: Aproximative string matching

2005-11-21 Thread Diez B. Roggisch
soundex.htm > > > Soundex is *one* particular algorithm for approximate string matching. > It is optimised for matching Anglo-American names (like Smith/Smythe), > and is considered to be quite old and obsolete for all but the most > trivial applications -- or so I'm tol

Re: Aproximative string matching

2005-11-21 Thread Tim Heaney
"javuchi" <[EMAIL PROTECTED]> writes: > I'm searching for a library which makes aproximative string matching, > for example, searching in a dictionary the word "motorcycle", but > returns similar strings like "motorcicle". > > Is t

Re: Aproximative string matching

2005-11-21 Thread Fredrik Lundh
Tim Roberts wrote: > >I'm searching for a library which makes aproximative string matching, > >for example, searching in a dictionary the word "motorcycle", but > >returns similar strings like "motorcicle". > > > >Is there such a library?

Re: Aproximative string matching

2005-11-21 Thread Daniel Dittmar
javuchi wrote: > I'm searching for a library which makes aproximative string matching, > for example, searching in a dictionary the word "motorcycle", but > returns similar strings like "motorcicle". > > Is there such a library? > agrep (aproximate

Re: Aproximative string matching

2005-11-20 Thread Tim Roberts
"javuchi" <[EMAIL PROTECTED]> wrote: > >I'm searching for a library which makes aproximative string matching, >for example, searching in a dictionary the word "motorcycle", but >returns similar strings like "motorcicle". > >Is there

Re: Aproximative string matching

2005-11-20 Thread Steven D'Aprano
#x27;t match cat and mat. A more sophisticated approximate string matching algorithm will use the Levenshtein distance. You can find a Useless implementation here: http://www.uselesspython.com/download.php?script_id=108 Given a function levenshtein(s1, s2) that returns the distance between t

Re: Aproximative string matching

2005-11-20 Thread elbertlev
This algorithm is called soundex. Here is one implementation example. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52213 here is another: http://effbot.org/librarybook/soundex.htm -- http://mail.python.org/mailman/listinfo/python-list

Aproximative string matching

2005-11-20 Thread javuchi
I'm searching for a library which makes aproximative string matching, for example, searching in a dictionary the word "motorcycle", but returns similar strings like "motorcicle". Is there such a library? -- http://mail.python.org/mailman/listinfo/python-list