Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re^6: Comparing Lines within a Word List

by dominick_t (Acolyte)
on Apr 30, 2016 at 14:49 UTC ( #1161953=note: print w/replies, xml ) Need Help??

in reply to Re^5: Comparing Lines within a Word List
in thread Comparing Lines within a Word List

Right, I'm still too new to regular expressions to make head or tails of this, but with enough time I'll be able to parse it. At the moment I'm just hoping to get something that works so that I can meet my deadline; after that I'll be able to focus on the actual learning.

I'm noticing now that this new code is calling pairs matches that shouldn't be, such as 'baa' and 'bbb'. These shouldn't match because there are two positions where the words differ. I think I have enough correct matches to finish the puzzle I'm working on, so I wouldn't call it urgent, but soon it will be an important thing for me to look at and figure out.

  • Comment on Re^6: Comparing Lines within a Word List

Replies are listed 'Best First'.
Re^7: Comparing Lines within a Word List
by hippo (Chancellor) on Apr 30, 2016 at 15:16 UTC

    All of the approaches in this subthread are based upon graff's original statement about his interpretation of your problem:

    OTOH, if you're looking for words that contain a particular pair of characters, and differ only in terms of using one vs. the other of those two (e.g. you really just want "bare/base", etc., but not "foot/fool"), you would probably want to use a regex like this ...

    Having computed set of "matches" for each term you can choose to refine that such that they differ by only one character using the other approaches (bitwise OR, Levenshtein, etc) mentioned elsewhere in the thread.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1161953]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2021-04-14 07:31 GMT
Find Nodes?
    Voting Booth?

    No recent polls found