Using C#, how can I replace similar words?

后端 未结 5 2055
孤城傲影
孤城傲影 2021-02-04 17:26

Assuming these two strings:

string s1=\"control\";
string s2=\"conrol\"; (or \"ocntrol\", \"onrtol\", \"lcontro\" etc.)

How can I programatical

5条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-04 18:06

    I'd use matlab to run some tests on this. I would do the follow

    CONTROL 1111111

    OCNTROL 0011111

    ONRCTOL 0000111

    So I have all 1s for original word, than I have five 1s in a second case and three 1s in a third. You can say that 70% is acceptable and if 70% match than I will use this word. OCNTROL will get accepted, but ONRCTOL won't.

    I say Matlab because you can easily load a lot of data into vectors and do vector comparissons.

提交回复
热议问题