Inverted Index in practice

来源:互联网 发布:小米平板windows版 编辑:程序博客网 时间:2024/05/21 09:31

 I always think that inverted-index is applied in search-engine.So fool......

Today a problem is that if there are millions of words,give you several  words that get most similar one .For examle,to a 3-len words.The request is that hits the target 2/3 in words at least.

First ,I thought of top(K) and then I learned a new way to sovle it "Inverted-Index".

In the first loop,make a new Inverted-index table that includes all the single character which appeared in the words.

To the new words if it is 3 char length,the request is as above.Divide it 2 char for a group and make intersecion.

At last the most similar words is got.It is a good way.

 

原创粉丝点击