LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-10-2013, 02:38 AM   #1
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,357

Rep: Reputation: 213Reputation: 213Reputation: 213
How to recognize which word from a list?


Hi,

I have a list of words which are my database, and I would
like that linux (aspell, ...or other non x11) can find
out which matching word it might be.

List={ "scanner" , "printer" , "hardware" , "processor" }

Into my input, if I give : "scahnner" or "trasher", it will give me the solution (closer "wording") :
scanner


Which program could do similar thing? I thought aspell, but nope

Thank you in advance if you have any possible idea.
Regards
 
Old 06-10-2013, 05:30 AM   #2
Ygrex
Member
 
Registered: Nov 2004
Location: Russia (St.Petersburg)
Distribution: Debian
Posts: 666

Rep: Reputation: 68
probably this algorithm can be helpful: http://en.wikipedia.org/wiki/Levenshtein_distance
 
Old 06-10-2013, 07:56 AM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 7.7 (?), Centos 8.1
Posts: 17,814

Rep: Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553
You could try http://perldoc.perl.org/perlfaq4.htm...of-a-string%3F
 
Old 06-11-2013, 01:52 PM   #4
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian + kde 4 / 5
Posts: 6,848

Rep: Reputation: 2012Reputation: 2012Reputation: 2012Reputation: 2012Reputation: 2012Reputation: 2012Reputation: 2012Reputation: 2012Reputation: 2012Reputation: 2012Reputation: 2012
TRE is an approximate matching regex engine. It comes with tre-agrep, for direct use.

http://laurikari.net/tre/

There's not a whole lot of documentation for it though. I haven't yet figured out more than a few basic configurations so far myself.

There are several other approximate matching solutions out there, I believe, including an older agrep.

Edit: fstrcmp might also come in useful, although it appears to be more of a string-to-string comparison tool. Again, it provides a simple shell interface in addition to the library itself.

http://fstrcmp.sourceforge.net/

Last edited by David the H.; 06-11-2013 at 02:00 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ls to list files withouth my key word! Drigo Linux - Newbie 8 02-05-2013 08:41 PM
[SOLVED] Append numbers to a word list? cat... NothingToLose Programming 8 12-30-2010 09:36 PM
[SOLVED] creating a list of word using tr command arvindk.monu Programming 5 07-13-2010 01:02 AM
Word list generation (all combinations) from a list of characters llattan Linux - Newbie 1 04-07-2009 08:41 PM
translate from word list in a file Critcho Linux - Newbie 1 03-20-2007 08:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration