Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 53375
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T17:03:13+00:00 2026-05-10T17:03:13+00:00

I noticed some posts here on string matching, which reminded me of an old

  • 0

I noticed some posts here on string matching, which reminded me of an old problem I’d like to solve. Does anyone have a good Levenshtein-like algorithm that is weighted toward Qwerty keyboards?

I want to compare two strings, and and allow for typos. Levenshtein is okay, but I’d prefer to also accept spelling errors based on the physical distance between keys on Qwerty keyboard. In other words, the algorithm should prefer ‘yelephone’ to ‘zelephone’ since the ‘y’ key is located nearer to the ‘t’ key than to the ‘z’ key on most keyboards.

Any help would be great… this feature isn’t central to my project, so I don’t want to veer off into a rat-hole when I should be doing something more productive.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T17:03:13+00:00Added an answer on May 10, 2026 at 5:03 pm

    In bioinformatics when you align two sequences of DNA you might have a model that has a different cost based on if the substitution is a transition or a transversion. This is exactly what you want but instead of a 4×4 matrix, you want a 40×40 matrix or some, dare I say distance function? So the cost of a replacement is from the matrix/function, not a constant.

    CAVEAT: Be sure that deletions and insertions are weighted properly though, so they aren’t over accepted as the minimum. You’ll end up with a string of insertions/deletions/no-change-substitution characters.

    The new function you are trying to minimize would be:

    d[i, j] := minimum(     d[i-1, j] + del_cost,     d[i, j-1] + ins_cost,     d[i-1, j-1] + keyboard_distance( s[i], t[j] ) ) 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 153k
  • Answers 153k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer If you are set on doing this from scratch (Will's… May 12, 2026 at 10:16 am
  • Editorial Team
    Editorial Team added an answer NSIndexPath isn't mutable, so you'll have to create a new… May 12, 2026 at 10:16 am
  • Editorial Team
    Editorial Team added an answer Be sure you create your project local first. Commit it… May 12, 2026 at 10:16 am

Related Questions

Surprisingly I was only able to find one previous question on SO about this
this may seem trivial but I'm setting up, on a profile form page I'm
I wanted to get a feedback from you guys (and hopefully some references to
I am trying to POST a HTML (contained in a file) to a URL

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.