LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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, 01:38 AM   #1
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,657

Rep: Reputation: 255Reputation: 255Reputation: 255
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, 04: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, 06:56 AM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

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

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
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 01:00 PM.
 
  


Reply



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 07:41 PM
[SOLVED] Append numbers to a word list? cat... NothingToLose Programming 8 12-30-2010 08:36 PM
[SOLVED] creating a list of word using tr command arvindk.monu Programming 5 07-13-2010 12:02 AM
Word list generation (all combinations) from a list of characters llattan Linux - Newbie 1 04-07-2009 07:41 PM
translate from word list in a file Critcho Linux - Newbie 1 03-20-2007 07:30 AM

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

All times are GMT -5. The time now is 05:00 PM.

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