从c#中的段落中获得相同的字母。形成 [英] Getting alike letters from a paragraph in c# win. form

查看:82
本文介绍了从c#中的段落中获得相同的字母。形成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从段落中获得相同的字母,这些字母在c#win的段落中出现多个。表格。



示例: - 我的名字是而不是。我更喜欢sc ie nce humant ie s。



上面的例子应该给出输出而不是& ie 因为它在段落中出现两次。 [字母的最小匹配应为2个或更多字母]

有人能告诉我如何实现这个目标吗?







先谢谢

解决方案

你需要写一个寻找的字符串解析器每个单词中的相似序列。因此,您首先从句子中的第一个单词中提取各种集合,然后在剩余单词中搜索所有其他出现的内容。记下所有比赛的记录和数量。然后对句子中的所有其他单词重复此过程,直到处理完所有内容为止。


这看起来像后缀树 [ ^ ]。

书籍参考是:字符串,树和算法序列 [ ^

How to get alike letters from a paragraph which occur more than one in a paragraph in c# win. form.

Example:-"My name is jonathan. I prefer science than humanties."

The above example should give output than & ie as it appears twice in the paragraph. [minimum match for letters should be 2 or more letters]
Can somebody give me an idea how to achieve this?



Thanks in Advance

解决方案

You need to write a string parser that looks for similar sequences in each word. So you start by extracting the various sets from the first word in the sentence, and search for all other occurrences in the remaining words. Keep a note and count of all matches. Then repeat the process for all the other words in the sentence until you have processed everything.


This looks like a job for Suffix Trees[^].
A book reference is: Algorithms on Strings, Trees, and Sequences[^]


这篇关于从c#中的段落中获得相同的字母。形成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆