2

I'm trying to merge words that have the same base. Example:

  • accident
  • accidental
  • accidentally
  • accidents

or

  • abandon
  • abandoned
  • abandoning

At first I used the

 Word.Application().SynonymInfo[myWord, Word.WdLanguageID.wdEnglishUS];

to get synonyms of a word from word.dll. But I realized that I don't wanna merge only synonyms but words with the same base.

Is there any function I could use from word.dll or any dll that would return if 2 words have the same base?

Marc
  • 16,170
  • 20
  • 76
  • 119

2 Answers2

2

You are probably looking for Inflector which is an open source library.

It is made .Net 3.5 compatible

Here is a sample code for it.

Rahul Tripathi
  • 168,305
  • 31
  • 280
  • 331
  • Base on this question http://stackoverflow.com/questions/8856347/how-to-know-if-two-words-have-the-same-base, it wouldn't work for verbs. is that right? – Marc Oct 19 '13 at 17:34
  • @Marc:- Yes. You can also get some help from here:- http://cid-net.googlecode.com/svn/trunk/src/Cid.Mvc/Inflector.cs – Rahul Tripathi Oct 19 '13 at 17:36
1

English language has lot of exceptions but taking care of few most common scenarios using your own little function will take care of 90% cases.

It seems to be there are few common Scenarios:

a) Past tense : by adding suffix "ed"

b) Plurals : by adding "s", "es",

c) Common Suffix for making adjective :

d) Common Suffix for Adverb

e) Common Suffix used for converting verb to noun

So, by removing common suffix from words, we can try to merge the words which results in same base.

For not so common scenarios, may be, we can some string similar Algorithm to know if strings are similar are not. like using Levenshtein distance implementation:

using LINQ

Please see the following stackoverflow question also :

Are there any Fuzzy Search or String Similarity Functions libraries written for C#?

Community
  • 1
  • 1
James
  • 173
  • 1
  • 6