让我说我有一个长字符串str_1:
**str_1** : 'Computer once meant a person who did computations, but now the term almost universally refers to automated electronic machinery. The first section of this article focuses on modern digital electronic computers and their design'
,我有一个字符串str_2在长字符串中寻找:
**str_2** : 'The second section of this article focuses on modern digital electronic computers and their design'
str_2实际上存在于str_1中,但是str_2中的单词“ second”在str_1中被写为“ first”,唯一的区别是。
我想要的是在带有某些错误的字符串中搜索句子。我想找到有一定百分比错误的str,然后检查错误。有没有办法做到这一点。谢谢。
答案 0 :(得分:0)
您可以使用句子之间的jaccard相似度评分来确定两者之间的相似度。 Link Here
答案 1 :(得分:0)
您可以使用简单的正则表达式,例如
The (?:first|second) section of this article focuses on modern digital electronic computers and their design