如何搜索相似的单词 [英] How to search for similar words

查看:151
本文介绍了如何搜索相似的单词的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个记录文件,我需要制作一个程序,通过在搜索字段中输入一个单词来帮助找到该记录中的任何单词。记录文件包含单词列表,所以我需要搜索该列表以找到任何可能与我的单词相似的单词。

我使用的是Delphi 2007 2007年应该有一个StrUtils中使用Soundex算法查找类似声音单词的字符串匹配例程数。根据您的文件格式化方式,您可以将其加载到TStringList中,然后在输入字段的OnChange事件处理程序中调用一个遍历列表的例程,并执行与用户输入和列表中的每个条目的soundex比较。
$ b 查看 ResemblesText SoundexCompare SoundexProc SoundexSimilar 。其中一个应该让你去。


I have a record file and I need to make a program that should help find any word into that record by typing a word into a search field. The record file contains a list of words so I need to search into that list to find any word that could be similar to my word.

I am using Delphi 2007

解决方案

Delphi 2007 should have a number of string matching routines in StrUtils that use the Soundex algorithm to find similar "sounding" words. Depending on how your file is formatted you may be able to load it into a TStringList then in the OnChange event handler of your input field call a routine that iterates through the list and performs a soundex comparison with the user's input and each entry in the list.

Look at ResemblesText, SoundexCompare, SoundexProc and SoundexSimilar. One of those should get you going.

这篇关于如何搜索相似的单词的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆