Solved

Delphi 5 Thesaurus component

Posted on 2001-07-16
7
149 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
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

830 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