word search

Discussion in 'Python' started by Andrea Cova, Mar 2, 2004.

  1. Andrea Cova

    Andrea Cova Guest

    Hi,
    i'm trying to write a program that finds single words that works like this:
    i'd like to find a word, the exact word, without making mistakes like, when
    i'm looking for 'cow', he tells me he found it in 'coward'.
    I have an idea how to do this in C, but i guess it would be less complicate
    in python.
    The findall() function would be ok, but i need to make some modifications
    like this one:
    I want the program to find matches only when the word isn't in the middle
    of other letters. Other kinds of chars instead are accepted. (for instance:
    ' cow ', '_cow_', '(cow)',' -cow, ' are right matches).


    I need this for a program that does the following: i've got a list of song
    titles, saved in a txt file for example, and a list of filenames in a
    directory (mp3 files), and for each song title i want to find the best
    match in the filenames.
    Then when all the matches are done I modify the mp3 files' tags according
    to the information in the txt file.
    I know there are windows programs to do this, but they don't have functions
    like taking a text list and find the corresponding mp3 on their own.

    And two little questions:

    1-i read in the manuals that if i want "search()" to ignore the case, i
    have to put the flag I. I can't get this to work. Could you write me an
    example of how to write this? I
    2-how can i make also "findall()" be case UNsensitive?

    Thank you.
     
    Andrea Cova, Mar 2, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Laura
    Replies:
    1
    Views:
    567
    Gunnar Hjalmarsson
    Jun 5, 2004
  2. Stephen Witter

    opening a word doc in word not browser

    Stephen Witter, May 18, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    526
    Stephen Witter
    May 18, 2004
  3. Luis Esteban Valencia
    Replies:
    2
    Views:
    2,982
    sanjupillai
    Sep 26, 2008
  4. Sharon
    Replies:
    0
    Views:
    633
    Sharon
    Jul 27, 2005
  5. Abby Lee
    Replies:
    5
    Views:
    475
    Abby Lee
    Aug 2, 2004
Loading...

Share This Page