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.
Inverted Index in practice
最新推荐文章于 2024-02-04 22:04:59 发布