Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #12324
| From | Emile van Sebille <emile@fenx.com> |
|---|---|
| Subject | Re: Arrange files according to a text file |
| Date | 2011-08-27 18:10 -0700 |
| References | <6j8i57t6cgqunn3c1ci4p7u9mnpnvsrl8s@4ax.com> <mailman.473.1314468400.27778.python-list@python.org> <opji57tr5n326aisk6uv373h4v09rtq876@4ax.com> <mailman.486.1314479310.27778.python-list@python.org> <o8ti57lf00gv696jg9p3ev8pc801rcdv0a@4ax.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.497.1314493823.27778.python-list@python.org> (permalink) |
On 8/27/2011 4:18 PM Ric@rdo.python.org said...
> Thank you so much. The code worked perfectly.
>
> This is what I tried using Emile code. The only time when it picked
> wrong name from the list was when the file was named like this.
>
> Data Mark Stone.doc
>
> How can I fix this? Hope I am not asking too much?
What name did it pick? I imagine if you're picking a name from a list
of 25000 names that some subset of combinations may yield like ratios.
But, if you double up on the file name side you may get closer:
for filename in filenames:
ratios = [SM(ignore,filename+filename,username).ratio() for
username in usernames]
best = max(ratios)
owner = usernames[ratios.index(best)]
print filename,":",owner
... on the other hand, if you've only got a 100 files to sort out, you
should already be done.
:)
Emile
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Arrange files according to a text file Ric@rdo - 2011-08-27 13:03 -0400
Re: Arrange files according to a text file MRAB <python@mrabarnett.plus.com> - 2011-08-27 18:22 +0100
Re: Arrange files according to a text file Emile van Sebille <emile@fenx.com> - 2011-08-27 11:06 -0700
Re: Arrange files according to a text file Ric@rdo - 2011-08-27 16:15 -0400
Re: Arrange files according to a text file Emile van Sebille <emile@fenx.com> - 2011-08-27 14:08 -0700
Re: Arrange files according to a text file Ric@rdo - 2011-08-27 19:18 -0400
Re: Arrange files according to a text file MRAB <python@mrabarnett.plus.com> - 2011-08-28 00:48 +0100
Re: Arrange files according to a text file Ric@rdo - 2011-08-27 20:21 -0400
Re: Arrange files according to a text file Emile van Sebille <emile@fenx.com> - 2011-08-27 18:10 -0700
Re: Arrange files according to a text file Ric@rdo - 2011-08-28 01:24 -0400
Re: Arrange files according to a text file Stephen Hansen <me+list/python@ixokai.io> - 2011-08-27 16:31 -0700
csiph-web