检测一个问题是否与另一个问题匹配 python 或 js?
Detect if a question matches another question with python or js?
我正在尝试找出如何检测一个问题是否与 python 或 JS 中的另一个问题相匹配。例如
检测到问题:
"Does anyone know the MySql password?"
与问题
相关
"Does anyone know the MySql password?"
为了在限制误报数量的同时给出自动回答。
`
let str1="Does anyone know the MySql password?";
let str2="Does anyone know the MySql password?";
let parsedStr1=str1.toLowerCase().replace(/\s/g,'');
let parsedStr2=str1.toLowerCase().replace(/\s/g,'');
parsedStr1.localeCompare(parsedStr2);
/* Expected Returns:
0: exact match
-1: string_a < string_b
1: string_a > string_b
*/
`
我正在尝试找出如何检测一个问题是否与 python 或 JS 中的另一个问题相匹配。例如 检测到问题:
"Does anyone know the MySql password?"
与问题
相关"Does anyone know the MySql password?"
为了在限制误报数量的同时给出自动回答。
`
let str1="Does anyone know the MySql password?";
let str2="Does anyone know the MySql password?";
let parsedStr1=str1.toLowerCase().replace(/\s/g,'');
let parsedStr2=str1.toLowerCase().replace(/\s/g,'');
parsedStr1.localeCompare(parsedStr2);
/* Expected Returns:
0: exact match
-1: string_a < string_b
1: string_a > string_b
*/
`