Home > other >  How to match the highest similarity of string in an array and output
How to match the highest similarity of string in an array and output

Time:10-25

For example a list=[' aabb, abb, 'acccx], now have a query string=' aab ', are looking for similar to query the list of elements and the output, you how great god get this element,

CodePudding user response:

What is the most similar?
1, equal to? Using if *==*
2, contain or be included? With sliced
3, the similar format? 2 + 1?

CodePudding user response:

The fuzzy matching to consider, format, type, length, starting at the end, and fault tolerance, and so on! What are you going to do, the search engines do the somebody else all spent a lot of money a lot of time

CodePudding user response:

According to your now equals the code directly why similar, similar to the fuzzy matching search he belongs to, the cost is a problem

CodePudding user response:

Such as array has a "high-tech", "industrial assets", "high and new technology"] three elements, and the incoming "high tech" to match, with the highest similarity must be "high and new technology" this element in the array, is there any ways to do,

CodePudding user response:

The solution:
The first method:
There is, first Chinese word segmentation, abstract into vector, vector Angle calculation,
To search for "similarity algorithm (cosine similarity),

The second method:
The similarity of the string (extended KMP)
Please look at the article
https://blog.csdn.net/update7/article/details/72628827

CodePudding user response:

reference 4 floor weixin_45824631 response:
such as array has [" high-tech ", "industrial assets", "high and new technology"] three elements, and the incoming "high tech" to match, with the highest similarity must be "high and new technology" this element in the array, is there any ways to do,

This is to check whether contain the string, use the STR in STR
  • Related