Click here to Skip to main content
15,893,161 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hi all,

I want to find the repeated sentences/pharses and count their frequence in paragraphs or documents.

ex:
The paragraph:

On the Insert tab, the galleries include items that are designed to coordinate with the overall look of your document. You can use these galleries to insert tables, headers, footers, lists, cover pages, and other document building blocks. When you create pictures, charts, or diagrams, they also coordinate with your current document look. You can easily change the formatting of selected text in the document text by choosing a look for the selected text from the Quick Styles gallery on the Home tab. You can also format text directly by using the other controls on the Home tab. Most controls offer a choice of using the look from the current theme or using a format that you specify directly. To change the overall look of your document, choose new Theme elements on the Page Layout tab. To change the looks available in the Quick Style gallery, use the Change Current Quick Style Set command. Both the Themes gallery and the Quick Styles gallery provide reset commands so that you can always restore the look of your document to the original contained in your current template. On the Insert tab, the galleries include items that are designed to coordinate with the overall look of your document.

One of the repeated sentences/pharses is "On the Insert tab".
Its frequence is 2. How to find all of them?

Do you have any idea?

Many thanks!
Posted
Comments
Sergey Alexandrovich Kryukov 1-Feb-13 0:01am    
This is not a valid question. "Do you have any idea?" would make some sense when something is conceptually puzzling or just difficult. But here, this is nothing but some amount of work. So, what have you done so far?
—SA
Member 8064588 1-Feb-13 0:44am    
I am a new member and my English is not good. If there is any misunderstand, I sorry about this. In my question, I mean that I need someone help me find a solution for my problem. Thanks again!
Sergey Alexandrovich Kryukov 1-Feb-13 0:56am    
You English is good enough for me to understand you well. Please imagine, how this help can be done. This is only a Questions & Answers forum, so you need to ask something which can be answered in a more or less short post. It does not mean someone will do some big job for your. We share knowledge and experience, give advice, etc., but here... there are not any special "professional secrets", subliminal APIs or something very wise to share. This is just: design, prototype, write code, debug, etc. Design data structures, types responsible for parts of the task, algorithms....

Probably you should simply start solving the problem and ask more specific question when you stuck...
—SA
Member 8064588 1-Feb-13 1:35am    
Thanks for your advice! I will try to do and come back with specific task.
saephoed 1-Feb-13 14:50pm    
although it isn't really what you're probably looking for, this article may serve as a starting point:

http://www.codeproject.com/Questions/418859/How-to-find-number-of-words-sentences-paragraphs-m

adding another level of indirection to one of the provided solutions may be close to what you want

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900