in reply to Re: Re: using Word dictionary in Perl
in thread using Word dictionary in Perl
The (1) returns the synonymlist for the first meaning of the word. If you have a word that can mean many things, you could end up with many synonymlists. You'll then have to check the MeaningCount property and loop all the synonymlists for each meaning.#!/usr/bin/perl -w # Uses use strict; use Win32::OLE; use Win32::OLE::Const; # Create MSWord object and load constants my $MSWord = Win32::OLE->new('Word.Application', 'Quit') or die "Could not load MS Word\n"; my $wd=Win32::OLE::Const->Load($MSWord); # Word and language to search for my $word="big"; my $language=$wd->{wdEnglishUS}; # Get synonyms from MSWord my $synonyms=$MSWord->SynonymInfo( {Word => $word, LanguageID => $language})->SynonymList(1); # Print them out... foreach (@{ $synonyms }) { print $_."\n" };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: using Word dictionary in Perl
by Anonymous Monk on Dec 14, 2000 at 06:36 UTC | |
by t0mas (Priest) on Dec 14, 2000 at 12:33 UTC |