Solved

Delphi 5 Thesaurus component

Posted on 2001-07-16
7
145 Views
Last Modified: 2010-04-06
I need a free Thesaurus component  with source - no add-ons   I have tried ThesDB. DLL  but I can  not  work out how to access the DLL in delphi (5),  if I use MS-word component then  I can not work out how  import results back into my delphi program. - Need Delphi source code
0
Comment
Question by:MauriceToon
7 Comments
 
LVL 44

Expert Comment

by:CrazyOne
ID: 6288423
Listening
0
 
LVL 11

Accepted Solution

by:
robert_marquardt earned 100 total points
ID: 6288797
I just has a look at msth32.dll (Word 97)
ThesCheck
ThesCloseMdt
ThesInit
ThesOpenMdt
ThesTerminate
ThesVersion
are the only exported functions.
Do you have the C headers/documentation for these functions?
They seem all you need for accessing the Thesaurus files.
0
 

Author Comment

by:MauriceToon
ID: 6289085
not what I was looking for
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 2

Expert Comment

by:egono
ID: 6289116
you might use TWordApplication

[...]
var LangID        : OleVariant;
    Meaning       : OleVariant;
    mSysnonym     : SynonymInfo;
    i,j,k         : Integer;
    s             : string;
    mLine,mLine1  : Integer;

[...]
LangID:=wdGerman;
s:=Memo1.SelText;
if s='' then ShowMessage('Please mark word! ');
while s<>'' do
begin
  mSysnonym:=WordApplication1.SynonymInfo[s,LangId];
  if mSysnonym.Found then
  begin
    if not Assigned(ThesaurusForm) then
    begin
      ThesaurusForm:=TThesaurusForm.Create(nil);
    end;
    with ThesaurusForm do
    begin
      Edt_Word.Text:=s;
      SetLength(mSysLists,mSysnonym.MeaningCount+1);
      try
        for i:=1 to mSysnonym.MeaningCount do
        begin
          mSysLists[i-1]:=TStringList.Create;
          ListBox1.Items.Add(mSysnonym.MeaningList[i]);
          Meaning:=i;
          for j:=1 to MAXINT do
          begin
            try
              mSysLists[i-1].Add(mSysnonym.SynonymList[Meaning][j]);
              if Meaning=1 then ListBox2.Items.Add(mSysnonym.SynonymList[Meaning][j]);
            except Break; end;
          end;
        end;
        ListBox1.Items.Add('Ahnliche Begriffe');
        mSysLists[mSysnonym.MeaningCount]:=TStringList.Create;
        for i:=1 to MAXINT do
        begin
          try
            mSysLists[mSysnonym.MeaningCount].Add(mSysnonym.RelatedWordList[i]);
          except Break; end;
        end;
        k:=ShowModal;
        if (k=idOK) and (Edt_Replace.Text<>'') then
        begin
          Memo1.SelText:=Edt_Replace.Text;
          s:='';
        end else
        if (k=idRetry) then
        begin
          s:=ListBox2.Items[ListBox2.ItemIndex];
        end else
        if (k=idAbort) then  //back button
        begin
          s:=Memo1.SelText;
        end else
        begin
          s:='' ;
        end;
      finally
        ListBox1.Clear;
        ListBox2.Clear;
        for i:=0 to mSysnonym.MeaningCount do
        begin
          mSysLists[i].Free;
        end;
      end;
    end;
  end;
end;
[...]
0
 

Author Comment

by:MauriceToon
ID: 6296322
HI egono,
Outstanding code, but what is SynonymInfo  and ShowModal??
Maurice
mauricetoon@yahoo.co.nz
0
 

Author Comment

by:MauriceToon
ID: 6296899
HI egono,
Outstanding code, but what is wdGerman and showModal??
Maurice
mauricetoon@yahoo.co.nz
0
 

Author Comment

by:MauriceToon
ID: 6296905
I now know what SynonymInfo is but not idea about
wdGerman and showModal??
Thanks
Maurice
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now