Can I see different forms of words through the Word API?

I am wondering if another word form can be seen through the Word API. I am creating an Open Source tool that automatically adds documentation to properties and methods when saving a document. This will be done only for public or protected methods.

The way I want to work is that if you follow a specific naming convention and use (for example) the AddPerson or add_person method name, the code takes these method names and converts them into an array of words, "Add" and "Face".

From these words, I would like to determine whether it is a verb or a noun. For example, in this example, β€œAdd” is a verb, and β€œPerson” is a noun.

Once this is discovered, I would also like to convert the words to form the following documentation statement:

AddPerson (face)

Adds a person.

person: person.

I hope you understand.

In short, how can I convert Add to Add in a smart way, and how can I determine if Add is a verb or a noun programmatically?

I assumed that the Word API would be a good start. I just have no idea how.

+6
source share
1 answer

I ended up using System.Data.Entity.Design.PluralizationServices.PluralizationService from the Entity Framework, which does an excellent job.

The project can be found here:

http://todoc.codeplex.com/

Still working on it.

+1
source

Source: https://habr.com/ru/post/913735/


All Articles