soundex

Data structure for soundex algorithm?

自作多情 提交于 2019-12-10 11:07:07
问题 Can anyone suggest me on what data structure to use for a soundex algorithm program? The language to be used is Java. If anybody has worked on this before in Java. The program should have these features: be able to read about 50,000 words should be able to read a word and return the related words having the same soundex I don't want the program implementation just few advices on what data structure to use. 回答1: TIP: If you use SQL as a databackend then you can let SQL handle it with the two

Sort By Soundex (or similar) `Closeness`

爷,独闯天下 提交于 2019-12-10 03:26:51
问题 Is there any way to have MySQL order results by how close they 'sound' to a search term? I'm trying to order fields that contain user input of city names. Variations and misspellings exist, and I'd like to show the 'closest' matches at the top. I know soundex may not be the best algorithm for this, but if it (or another method) could be reasonable successful - it may be worth having the sorting done by the database. 回答1: Soundex is no good for this sort of thing because different words can

Replace words using Soundex, python

心已入冬 提交于 2019-12-07 16:32:56
问题 i have a list of sentences and basically my aim is to replace all diff occurrences of prepositions in the form "opp,nr,off,abv,behnd" with their correct spellings "opposite,near,above,behind" and so on. The soundex code of the words are same so i need to build an expression to iterate over this list word by word and if the soundex is same, replace it with the right spelling. An example - ['Jack was standing nr the tree' , 'they were abv everything he planned' , 'Just stand opp the counter' ,

LINQ to SQL SOUNDEX - possible?

穿精又带淫゛_ 提交于 2019-12-06 19:58:17
问题 I have done a little bit of research on this and looked through a few articles both here on StackOverflow as well as some blog posts, but haven't found an exact answer. I also read that it is possible to do it using the 4.0 framework, but have yet to find any supporting evidence. So my question, is it possible to perform SOUNDEX via a LINQ to SQL Query? 回答1: You can do this at the database, by using a fake UDF; in a partial class, add a method to the data context: [DbFunction(Name = "SoundEx"

Data structure for soundex algorithm?

蓝咒 提交于 2019-12-06 06:51:28
Can anyone suggest me on what data structure to use for a soundex algorithm program? The language to be used is Java. If anybody has worked on this before in Java. The program should have these features: be able to read about 50,000 words should be able to read a word and return the related words having the same soundex I don't want the program implementation just few advices on what data structure to use. Stefan TIP: If you use SQL as a databackend then you can let SQL handle it with the two sql-functions SOUNDEX and DIFFERENCE. Maybe not what you wanted, but many people do not know that

Replace words using Soundex, python

陌路散爱 提交于 2019-12-05 22:33:24
i have a list of sentences and basically my aim is to replace all diff occurrences of prepositions in the form "opp,nr,off,abv,behnd" with their correct spellings "opposite,near,above,behind" and so on. The soundex code of the words are same so i need to build an expression to iterate over this list word by word and if the soundex is same, replace it with the right spelling. An example - ['Jack was standing nr the tree' , 'they were abv everything he planned' , 'Just stand opp the counter' , 'Go twrds the gas station'] so i need to replace words nr,abv ,opp and twrds with their right full

Implement smart search / Fuzzy string comparison

纵然是瞬间 提交于 2019-12-04 23:11:56
问题 I have a web page on an ASP.NET MVC application where customers search for suppliers. The suppliers capture their own details on the website. The client wants a "smart search" feature, where they could search for suppliers and find them even if the supplier spelling is "slightly different" to what is typed in the search box. I have no idea what the client's notion of "slightly different" is. I've been looking into implementing a custom soundex algorithm. This converts a word into a number

DotNet Soundex Function

核能气质少年 提交于 2019-12-03 20:24:39
问题 I have a database table that has a column of SQLServer Soundex encoded last name + first name. In my C# program I would like to convert a string using soundex for use in my query. Is there either a standard string function for soundex in the dotnet library or is the an open source library that implements it (perhaps as an extension method on string)? 回答1: I know this is late, but I also needed something similar (though no database involved), and the only answer isn't accurate (fails for

Implement smart search / Fuzzy string comparison

廉价感情. 提交于 2019-12-03 13:52:43
I have a web page on an ASP.NET MVC application where customers search for suppliers. The suppliers capture their own details on the website. The client wants a "smart search" feature, where they could search for suppliers and find them even if the supplier spelling is "slightly different" to what is typed in the search box. I have no idea what the client's notion of "slightly different" is. I've been looking into implementing a custom soundex algorithm. This converts a word into a number based on how it sounds. That number is then used for comparison. For example: Zach Zack will encode to the

PHP/MySQL: Highlight “SOUNDS LIKE” query results

青春壹個敷衍的年華 提交于 2019-12-03 09:08:43
Quick MYSQL/PHP question. I'm using a "not-so-strict" search query as a fallback if no results are found with a normal search query, to the tune of: foreach($find_array as $word) { clauses[] = "(firstname SOUNDS LIKE '$word%' OR lastname SOUNDS LIKE '$word%')"; } if (!empty($clauses)) $filter='('.implode(' AND ', $clauses).')'; $query = "SELECT * FROM table WHERE $filter"; Now, I'm using PHP to highlight the results, like: foreach ($find_array as $term_to_highlight){ foreach ($result as $key => $result_string){ $result[$key]=highlight_stuff($result_string, $term_to_highlight); } } But this