Exontrol.ExDICTClient - Information, Features

ExDICTClient

The ExDICTClient ActiveX control is a TCP transaction based query/response protocol that allows a client to access dictionary definitions from a set of natural language dictionary databases. The ExDICTClient ActiveX control uses the Dictionary Protocol, described in RFC 2229. The ExDICTClient is easy to use, and it does not require to much experience to use it. For many years, the Internet community has relied on the "webster" protocol for access to natural language definitions. The webster protocol supports access to a single dictionary and (optionally) to a single thesaurus. In recent years, the number of publicly available webster servers on the Internet has dramatically decreased. The DICT protocol is designed to provide access to multiple databases. Word definitions can be requested, the word index can be searched (using an easily extended set of algorithms), information about the server can be provided (e.g., which index search strategies are supported, or which databases are available), and information about a database can be provided (e.g., copyright, citation, or distribution information). Further, the DICT protocol has hooks that can be used to restrict access to some or all of the databases.

For instance, the following VB sample displays the definition for "control":

Private Sub Form_Load()
    Dim c As ExDICTClientLibCtl.Connection
    Set c = Client1.OpenConnection("dict.org")
    If Not (c Is Nothing) Then
        With c.CreateQuery("control", , c.Strategies("exact"))
            Dim r As ExDICTClientLibCtl.IResult
            For Each r In .Execute
                Debug.Print " Searching the '" & r.Word & "' in '" & r.Dictionary.Name & "' dictionary gets: "
                Dim d As ExDICTClientLibCtl.IDefinition
                Dim i As Long
                For i = 0 To r.Definitions.Count - 1
                    Set d = r.Definitions.Item(i)
                    Debug.Print d.Body
                Next
            Next
        End With
        c.Close
    End If
    Set c = Nothing
End Sub

® ExDICTClient is a trademark of Exontrol. All Rights Reserved.


Exontrol - Support

How to get support?

To keep your business applications running, you need support you can count on.

Here are few hints what to do when you're stuck on your programming:

  • Check out the samples - they are here to provide some quick info on how things should be done
  • Check out the how-to questions using the eXHelper tool
  • Check out the help - includes documentation for each method, property or event
  • Check out if you have the latest version, and if you don't have it send an update request here.
  • Submit your problem(question) here.

Don't forget that you can contact our development team if you have ideas or requests for new components, by sending us an e-mail at support@exontrol.com ( please include the name of the product in the subject, ex: exgrid ) . We're sure our team of developers will try to find a way to make you happy - and us too, since we helped.

Regards,
Exontrol Development Team

https://www.exontrol.com


Client object
Tip The /COM object can be placed on a HTML page (with usage of the HTML object tag: <object classid="clsid:...">) using the class identifier: {8073D69D-EEF7-48F3-82DE-A6D52D47E3AE}. The object's program identifier is: "Exontrol.DictClient". The /COM object module is: "ExDictClient.dll"
The Client object supports the following properties and methods:

Name | Description
ExecuteQuery | Convenient method for executing queries
OpenConnection | Opens a connection to a dict server


method ExecuteQuery

method Client.ExecuteQuery (host as String, expression as String)
Convenient method for executing queries

Type | Description
host as String | A string expression that defines the host
expression as String | A string expression to send
Return | Description
Results | Holds the result after queering the server
Convenient method for executing queries


method OpenConnection

method Client.OpenConnection (host as String, [port as Long])
Opens a connection to a dict server

Type | Description
host as String | A string expression that indicates the DICT server address. For instance: "dict.org"
port as Long | A long expression that indicates the port used to communicate with the DICT server. BY default, the port parameter is 2628, as described in the RFC 2229.
Return | Description
Connection | A Connection object being created.

Use the OpenConnection method to open a connection to a DICT server.

The following sample prints the available dictionaries on the server:

Private Sub Form_Load()
    Dim c As EXDICTCLIENTLibCtl.Connection
    Set c = Client1.OpenConnection("dict.org")
    If Not (c Is Nothing) Then
        Dim d As EXDICTCLIENTLibCtl.IDictionary
        For Each d In c.Dictionaries
            Debug.Print d.Name
        Next
        c.Close
    End If
End Sub


Connection object
The Connection object stabilities a connection between the client and a DICT server. Use the OpenConnection property to get a Connection object. The Connection object supports the following properties and methods:

Name | Description
Close | Closes an opened connection
CreateQuery | Creates a query object
Dictionaries | Returns a collection of dictionaries available on the server
Info | Returns information about server
LineStream | Retrieves a LineStream object to send custom commands to the server.
Open | Opens a connection to a dict server
Strategies | Returns a collection of strategies that can be used for queries


method Close

method Connection.Close ()
Closes an opened connection

Type Description

< put_remarks_here >


method CreateQuery

method Connection.CreateQuery (expression as String, [Dictionary as Dictionary], [strategy as Strategy])
Creates a query object

Type | Description
expression as String | A string expression that indicates the expression being searched.
Dictionary as Dictionary | A Dictionary object where the expression is searched. If the Dictionary object is missing, the expression is searched in all available dictionaries.
strategy as Strategy | A Strategy object that indicates the strategy to use when searching. If the strategy parameter is missing all strategies are used.
Return | Description
Query | A Query object that holds the DICT server answer.

The CreateQuery property creates a query object. Use the Execute method to send the query to a DICT server. Use the Dictionaries property to get all available dictionaries. Use the Strategies property to get the available strategies on the server.

The following sample displays the definitions for "dog" word in all dictionaries using all strategies:

Private Sub Form_Load()
    Dim c As EXDICTCLIENTLibCtl.Connection
    Set c = Client1.OpenConnection("dict.org")
    If Not (c Is Nothing) Then
        With c.CreateQuery("dog")
            Dim r As EXDICTCLIENTLibCtl.IResult
            For Each r In .Execute
                Debug.Print " Searching the '" & r.Word & "' in '" & r.Dictionary.Name & "' dictionary gets: "
                Dim d As EXDICTCLIENTLibCtl.IDefinition
                For Each d In r.Definitions
                    Debug.Print d.Body
                Next
            Next
        End With
        c.Close
    End If
    Set c = Nothing
End Sub

If you run the sample you should get a result like follows:

Searching the 'dog' in 'web1913' dictionary gets:

Sundog \Sun"dog`\, n. (Meteor.)
   A fragmentary rainbow; a small rainbow near the horizon; --
   called also {dog} and {weathergaw}.

Dog \Dog\ (d[o^]g), n. [AS. docga; akin to D. dog mastiff, Dan.
   dogge, Sw. dogg.]
   1. (Zo["o]l.) A quadruped of the genus {Canis}, esp. the
      domestic dog ({C. familiaris}).

   Note: The dog is distinguished above all others of the
         inferior animals for intelligence, docility, and
         attachment to man. There are numerous carefully bred
         varieties, as the beagle, bloodhound, bulldog,
         coachdog, collie, Danish dog, foxhound, greyhound,
         mastiff, pointer, poodle, St. Bernard, setter, spaniel,
         spitz dog, terrier, etc. There are also many mixed
         breeds, and partially domesticated varieties, as well
         as wild dogs, like the dingo and dhole. (See these
         names in the Vocabulary.)

   2. A mean, worthless fellow; a wretch.

            What is thy servant, which is but a dog, that he
            should do this great thing?           -- 2 Kings
                                                  viii. 13 (Rev.
                                                  Ver. )

   3. A fellow; -- used humorously or contemptuously; as, a sly
      dog; a lazy dog. [Colloq.]

   4. (Astron.) One of the two constellations, Canis Major and
      Canis Minor, or the Greater Dog and the Lesser Dog. Canis
      Major contains the Dog Star (Sirius).

   5. An iron for holding wood in a fireplace; a firedog; an
      andiron.

   6. (Mech.)
      (a) A grappling iron, with a claw or claws, for fastening
          into wood or other heavy articles, for the purpose of
          raising or moving them.
      (b) An iron with fangs fastening a log in a saw pit, or on
          the carriage of a sawmill.
      (c) A piece in machinery acting as a catch or clutch;
          especially, the carrier of a lathe, also, an
          adjustable stop to change motion, as in a machine
          tool.

   Note: Dog is used adjectively or in composition, commonly in
         the sense of relating to, or characteristic of, a dog.
         It is also used to denote a male; as, dog fox or g-fox,
         a male fox; dog otter or dog-otter, dog wolf, etc.; --
         also to denote a thing of cheap or mean quality; as,
         dog Latin.

   {A dead dog}, a thing of no use or value. --1 Sam. xxiv. 14.

   {A dog in the manger}, an ugly-natured person who prevents
      others from enjoying what would be an advantage to them
      but is none to him.

   {Dog ape} (Zo["o]l.), a male ape.

   {Dog cabbage}, or {Dog's cabbage} (Bot.), a succulent herb,
      native to the Mediterranean region ({Thelygonum
      Cynocrambe}).

   {Dog cheap}, very cheap. See under {Cheap}.

   {Dog ear} (Arch.), an acroterium. [Colloq.]

   {Dog flea} (Zo["o]l.), a species of flea ({Pulex canis})
      which infests dogs and cats, and is often troublesome to
      man. In America it is the common flea. See {Flea}, and
      {Aphaniptera}.

   {Dog grass} (Bot.), a grass ({Triticum caninum}) of the same
      genus as wheat.

   {Dog Latin}, barbarous Latin; as, the dog Latin of pharmacy.

   {Dog lichen} (Bot.), a kind of lichen ({Peltigera canina})
      growing on earth, rocks, and tree trunks, -- a lobed
      expansion, dingy green above and whitish with fuscous
      veins beneath.

   {Dog louse} (Zo["o]l.), a louse that infests the dog, esp.
      {H[ae]matopinus piliferus}; another species is
      {Trichodectes latus}.

   {Dog power}, a machine operated by the weight of a dog
      traveling in a drum, or on an endless track, as for
      churning.

   {Dog salmon} (Zo["o]l.), a salmon of northwest America and
      northern Asia; -- the {gorbuscha}; -- called also {holia},
      and {hone}.

   {Dog shark}. (Zo["o]l.) See {Dogfish}.

   {Dog's meat}, meat fit only for dogs; refuse; offal.

   {Dog Star}. See in the Vocabulary.

   {Dog wheat} (Bot.), Dog grass.

   {Dog whelk} (Zo["o]l.), any species of univalve shells of the
      family {Nassid[ae]}, esp. the {Nassa reticulata} of
      England.

   {To give, or throw}, {to the dogs}, to throw away as useless.
      ``Throw physic to the dogs; I'll none of it.'' --Shak.

   {To go to the dogs}, to go to ruin; to be ruined.

Dog \Dog\, v. t. [imp. & p. p. {Dogged}; p. pr. & vb. n.
   {Dogging}.]
   To hunt or track like a hound; to follow insidiously or
   indefatigably; to chase with a dog or dogs; to worry, as if
   by dogs; to hound with importunity.

         I have been pursued, dogged, and waylaid. -- Pope.

         Your sins will dog you, pursue you.      --Burroughs.

         Eager ill-bred petitioners, who do not so properly
         supplicate as hunt the person whom they address to,
         dogging him from place to place, till they even extort
         an answer to their rude requests.        -- South.

 Searching the 'Dog' in 'web1913' dictionary gets:

Sundog \Sun"dog`\, n. (Meteor.)
   A fragmentary rainbow; a small rainbow near the horizon; --
   called also {dog} and {weathergaw}.

}.]
   To hunt or track like a hound; to follow insidiously or
   indefatigably; to chase with a dog or dogs; to worry, as if
   by dogs; to hound with importunity.

         I have been pursued, dogged, and waylaid. -- Pope.

         Your sins will dog you, pursue you.      --Burroughs.

         Eager ill-bred petitioners, who do not so properly
         supplicate as hunt the person whom they address to,
         dogging him from place to place, till they even extort
         an answer to their rude requests.        -- South.

Dog \Dog\ (d[o^]g), n. [AS. docga; akin to D. dog mastiff, Dan.
   dogge, Sw. dogg.]
   1. (Zo["o]l.) A quadruped of the genus {Canis}, esp. the
      domestic dog ({C. familiaris}).

   Note: The dog is distinguished above all others of the
         inferior animals for intelligence, docility, and
         attachment to man. There are numerous carefully bred
         varieties, as the beagle, bloodhound, bulldog,
         coachdog, collie, Danish dog, foxhound, greyhound,
         mastiff, pointer, poodle, St. Bernard, setter, spaniel,
         spitz dog, terrier, etc. There are also many mixed
         breeds, and partially domesticated varieties, as well
         as wild dogs, like the dingo and dhole. (See these
         names in the Vocabulary.)

   2. A mean, worthless fellow; a wretch.

            What is thy servant, which is but a dog, that he
            should do this great thing?           -- 2 Kings
                                                  viii. 13 (Rev.
                                                  Ver. )

   3. A fellow; -- used humorously or contemptuously; as, a sly
      dog; a lazy dog. [Colloq.]

   4. (Astron.) One of the two constellations, Canis Major and
      Canis Minor, or the Greater Dog and the Lesser Dog. Canis
      Major contains the Dog Star (Sirius).

   5. An iron for holding wood in a fireplace; a firedog; an
      andiron.

   6. (Mech.)
      (a) A grappling iron, with a claw or claws, for fastening
          into wood or other heavy articles, for the purpose of
          raising or moving them.
      (b) An iron with fangs fastening a log in a saw pit, or on
          the carriage of a sawmill.
      (c) A piece in machinery acting as a catch or clutch;
          especially, the carrier of a lathe, also, an
          adjustable stop to change motion, as in a machine
          tool.

   Note: Dog is used adjectively or in composition, commonly in
         the sense of relating to, or characteristic of, a dog.
         It is also used to denote a male; as, dog fox or g-fox,
         a male fox; dog otter or dog-otter, dog wolf, etc.; --
         also to denote a thing of cheap or mean quality; as,
         dog Latin.

   {A dead dog}, a thing of no use or value. --1 Sam. xxiv. 14.

   {A dog in the manger}, an ugly-natured person who prevents
      others from enjoying what would be an advantage to them
      but is none to him.

   {Dog ape} (Zo["o]l.), a male ape.

   {Dog cabbage}, or {Dog's cabbage} (Bot.), a succulent herb,
      native to the Mediterranean region ({Thelygonum
      Cynocrambe}).

   {Dog cheap}, very cheap. See under {Cheap}.

   {Dog ear} (Arch.), an acroterium. [Colloq.]

   {Dog flea} (Zo["o]l.), a species of flea ({Pulex canis})
      which infests dogs and cats, and is often troublesome to
      man. In America it is the common flea. See {Flea}, and
      {Aphaniptera}.

   {Dog grass} (Bot.), a grass ({Triticum caninum}) of the same
      genus as wheat.

   {Dog Latin}, barbarous Latin; as, the dog Latin of pharmacy.

   {Dog lichen} (Bot.), a kind of lichen ({Peltigera canina})
      growing on earth, rocks, and tree trunks, -- a lobed
      expansion, dingy green above and whitish with fuscous
      veins beneath.

   {Dog louse} (Zo["o]l.), a louse that infests the dog, esp.
      {H[ae]matopinus piliferus}; another species is
      {Trichodectes latus}.

   {Dog power}, a machine operated by the weight of a dog
      traveling in a drum, or on an endless track, as for
      churning.

   {Dog salmon} (Zo["o]l.), a salmon of northwest America and
      northern Asia; -- the {gorbuscha}; -- called also {holia},
      and {hone}.

   {Dog shark}. (Zo["o]l.) See {Dogfish}.

   {Dog's meat}, meat fit only for dogs; refuse; offal.

   {Dog Star}. See in the Vocabulary.

   {Dog wheat} (Bot.), Dog grass.

   {Dog whelk} (Zo["o]l.), any species of univalve shells of the
      family {Nassid[ae]}, esp. the {Nassa reticulata} of
      England.

   {To give, or throw}, {to the dogs}, to throw away as useless.
      ``Throw physic to the dogs; I'll none of it.'' --Shak.

   {To go to the dogs}, to go to ruin; to be ruined.

Dog \Dog\, v. t. [imp. & p. p. {Dogged}; p. pr. & vb. n.
   {Dogging}.]
   To hunt or track like a hound; to follow insidiously or
   indefatigably; to chase with a dog or dogs; to worry, as if
   by dogs; to hound with importunity.

         I have been pursued, dogged, and waylaid. -- Pope.

         Your sins will dog you, pursue you.      --Burroughs.

         Eager ill-bred petitioners, who do not so properly
         supplicate as hunt the person whom they address to,
         dogging him from place to place, till they even extort
         an answer to their rude requests.        -- South.

Searching the 'dog' in 'wn' dictionary gets:

dog
     n 1: a member of the genus Canis (probably descended from the
          common wolf) that has been domesticated by man since
          prehistoric times; occurs in many breeds; "the dog
          barked all night" [syn: {domestic dog}, {Canis
          familiaris}]
     2: a dull unattractive unpleasant girl or woman; "she got a
        reputation as a frump"; "she's a real dog" [syn: {frump}]
     3: informal term for a man; "you lucky dog"
     4: someone who is morally reprehensible; "you dirty dog" [syn:
        {cad}, {bounder}, {blackguard}, {hound}, {heel}]
     5: a smooth-textured sausage of minced beef or pork usually
        smoked; often served on a bread roll [syn: {frank}, {frankfurter},
         {hotdog}, {hot dog}, {wiener}, {wienerwurst}, {weenie}]
     6: a hinged catch that fits into a notch of a ratchet to move a
        wheel forward or prevent it from moving backward [syn: {pawl},
         {detent}, {click}]
     7: metal supports for logs in a fireplace; "the andirons were
        too hot to touch" [syn: {andiron}, {firedog}, {dog-iron}]
     v : go after with the intent to catch; "The policeman chased the
         mugger down the alley"; "the dog chased the rabbit" [syn:
          {chase}, {chase after}, {trail}, {tail}, {tag}, {give
         chase}, {go after}, {track}]
     [also: {dogging}, {dogged}]

 Searching the 'Dog' in 'easton' dictionary gets:

Dog
   frequently mentioned both in the Old and New Testaments. Dogs
   were used by the Hebrews as a watch for their houses (Isa.
   56:10), and for guarding their flocks (Job 30:1). There were
   also then as now troops of semi-wild dogs that wandered about
   devouring dead bodies and the offal of the streets (1 Kings
   14:11; 16:4; 21:19, 23; 22:38; Ps. 59:6, 14).

     As the dog was an unclean animal, the terms "dog," "dog's
   head," "dead dog," were used as terms of reproach or of
   humiliation (1 Sam. 24:14; 2 Sam. 3:8; 9:8; 16:9). Paul calls
   false apostles "dogs" (Phil. 3:2). Those who are shut out of the
   kingdom of heaven are also so designated (Rev. 22:15).
   Persecutors are called "dogs" (Ps. 22:16). Hazael's words, "Thy
   servant which is but a dog" (2 Kings 8:13), are spoken in mock
   humility=impossible that one so contemptible as he should attain
   to such power.

Searching the 'DOG' in 'devils' dictionary gets:

DOG, n.  A kind of additional or subsidiary Deity designed to catch
the overflow and surplus of the world's worship.  This Divine Being in
some of his smaller and silkier incarnations takes, in the affection
of Woman, the place to which there is no human male aspirant.  The Dog
is a survival -- an anachronism.  He toils not, neither does he spin,
yet Solomon in all his glory never lay upon a door-mat all day long,
sun-soaked and fly-fed and fat, while his master worked for the means
wherewith to purchase the idle wag of the Solomonic tail, seasoned
with a look of tolerant recognition.


property Dictionaries

property Connection.Dictionaries as Dictionaries
Returns a collection of dictionaries available on the server

Type | Description
Dictionaries | A Dictionaries object that holds a collection of Dictionary objects.

Use the Dictionaries property to get the list of available dictionaries on the server. Use the Strategies property to get the list of available strategies on the server.

The following sample displays the list of dictionaries available on the server:

Private Sub Form_Load()
    Dim c As EXDICTCLIENTLibCtl.Connection
    Set c = Client1.OpenConnection("dict.org")
    If Not (c Is Nothing) Then
        Dim d As EXDICTCLIENTLibCtl.IDictionary
        For Each d In c.Dictionaries
            Debug.Print d.Name & " " & d.Description
        Next
        c.Close
    End If
    Set c = Nothing
End Sub


property Info

property Connection.Info as String
Returns information about server

Type | Description
String | A string expression that gets information about the server.

The Info property gets information about the server. Use the Execute method to query a server.

For instance, the following sample displays the information about "dict.org" server:

Private Sub Form_Load()
    Dim c As EXDICTCLIENTLibCtl.Connection
    Set c = Client1.OpenConnection("dict.org")
    If Not (c Is Nothing) Then
        Debug.Print c.Info
        c.Close
    End If
    Set c = Nothing
End Sub

The server gets the information like follows:

dictd 1.8.0/rf on Linux 2.4.18-14
On pan.alephnull.com: up 15+21:41:48, 2341886 forks (6135.5/hour)

Database      Headwords         Index          Data  Uncompressed
elements            130          2 kB         14 kB         45 kB
web1913          185399       3438 kB         11 MB         30 MB
wn               154563       3089 kB       8744 kB         26 MB
gazetteer         52994       1087 kB       1754 kB       8351 kB
jargon             2373         42 kB        619 kB       1427 kB
foldoc            13801        268 kB       2142 kB       5898 kB
easton             3968         64 kB       1077 kB       2648 kB
hitchcock          2619         34 kB         33 kB         85 kB
devils              997         15 kB        161 kB        377 kB
world02             272          5 kB       1468 kB       6635 kB
vera               9203        103 kB        160 kB        558 kB


property LineStream

property Connection.LineStream as LineStream
Retrieves a LineStream object to send custom commands to the server.

Type | Description
LineStream | A LineStream object to send custom commands to the server.

Use the LineStream property to access the LineStream object to send custom commands to the server. The RFC 2229 describes the custom commands for the DICT protocol.

The following sample sends the "show db" command to the server, and gets the results:

Private Sub Form_Load()
    Dim c As EXDICTCLIENTLibCtl.Connection
    Set c = Client1.OpenConnection("dict.org")
    If Not (c Is Nothing) Then
        With c.LineStream
            .WriteLine "show db"
            Dim bContinue As Boolean
            bContinue = True
            While bContinue
                Dim s As String
                s = .ReadLine
                If (s = ".") Then
                    bContinue = False
                End If
                Debug.Print s
            Wend
        End With
        c.Close
    End If
    Set c = Nothing
End Sub

The sample sends the "show db" command to the server and gets the answer that server sends to the command, line by line until the server sends the '.' line. The "show db" command displays the list of currently accessible databases, one per line.


method Open

method Connection.Open (host as String, port as Long)
Opens a connection to a dict server

Type | Description
host as String | A string expression that defines the host
port as Long | A number expression that specifies the port to open

Opens a connection to a DICT server


property Strategies

property Connection.Strategies as Strategies
Returns a collection of strategies that can be used for queries

Type | Description
Strategies | A Strategies object that holds a collection of the strategies available on the server.

Use the Strategies property to get the collection of available strategies. Use the Dictionaries property to get the collection of available dictionaries. Use the CreateQuery property to query a DICT server.

The following sample displays the collection of strategies available on the DICT server:

Private Sub Form_Load()
    Dim c As EXDICTCLIENTLibCtl.Connection
    Set c = Client1.OpenConnection("dict.org")
    If Not (c Is Nothing) Then
        Dim d As EXDICTCLIENTLibCtl.IStrategy
        For Each d In c.Strategies
            Debug.Print d.Name & " " & d.Description
        Next
        c.Close
    End If
    Set c = Nothing
End Sub


Definition object
The Definition object holds a definition for the expression. Use the Execute method to send a query to a server. Use the Definitions property to access the collection of Definition objects. The Definition object supports the following properties and methods:

Name | Description
Body | Body text of the definition.
Result | Result object that contains this definition.


property Body

property Definition.Body as String
Body text of the definition.

Type | Description
String | A string expression that indicates the description of the definition.

Use the Body property to get the definition for an expression. Use the Execute method to query a server for an expression.

The following sample displays the definitions for "child" expression:

Private Sub Form_Load()
    Dim c As EXDICTCLIENTLibCtl.Connection
    Set c = Client1.OpenConnection("dict.org")
    If Not (c Is Nothing) Then
        With c.CreateQuery("hot", , c.Strategies("exact"))
            Dim r As EXDICTCLIENTLibCtl.IResult
            For Each r In .Execute
                Dim d As EXDICTCLIENTLibCtl.IDefinition
                For Each d In r.Definitions
                    Debug.Print d.Body
                Next
            Next
        End With
        c.Close
    End If
    Set c = Nothing
End Sub


property Result

property Definition.Result as Result
Result object that contains this definition.

Type | Description
Result | A Result object that holds the answer of the server to the client's query.

Use the Result property to access the object that generated the definition. the Use the Execute method to execute a query.

The following sample displays the "exact" definitions for the "dog" word:

Private Sub Form_Load()
    Dim c As EXDICTCLIENTLibCtl.Connection
    Set c = Client1.OpenConnection("dict.org")
    If Not (c Is Nothing) Then
        With c.CreateQuery("dog", , c.Strategies("exact"))
            Dim r As EXDICTCLIENTLibCtl.IResult
            For Each r In .Execute
                Debug.Print " Searching the '" & r.Word & "' in '" & r.Dictionary.Name & "' dictionary gets: "
                Dim d As EXDICTCLIENTLibCtl.IDefinition
                For Each d In r.Definitions
                    Debug.Print d.Body
                Next
            Next
        End With
        c.Close
    End If
    Set c = Nothing
End Sub


Definitions object
The Definitions object holds a collection of Definition objects. Use the Definitions property to get the collection of available definitions for an expression. Use the Execute method to send a query to a DICT server. The Definitions object supports the following properties and methods:

Name | Description
Count | Number of item in the collection.
Item | Returns an item within the collection. The key is the index of the item.


property Count

property Definitions.Count as Long
Number of item in the collection.

Type | Description
Long | A long expression that indicates the number of definitions.

The Count property counts the number of Definition objects in the Definitions collection. Use the Item property to access a specific definition.


property Item

property Definitions.Item (key as Long) as Definition
Returns an item within the collection. The key is the index of the item.

Type | Description
key as Long | A long expression that indicates the index of the definition in the collection. The collection is 0 based.
Definition | A Definition object that holds the definition.

The Count property counts the number of the definitions in the collection. Use the Definitions property to access the Definitions collection. The Item property of the Definitions collection is the default property for the Definitions object so the following statements are equivalents:

Definitions.Item(i)

or

Definitions(i)

The following sample displays all "exact" definitions for "cat" using the Item property:

Private Sub Form_Load()
    Dim c As EXDICTCLIENTLibCtl.Connection
    Set c = Client1.OpenConnection("dict.org")
    If Not (c Is Nothing) Then
        With c.CreateQuery("catalog", , c.Strategies("exact"))
            Dim r As EXDICTCLIENTLibCtl.IResult
            For Each r In .Execute
                Debug.Print " Searching the '" & r.Word & "' in '" & r.Dictionary.Name & "' dictionary gets: "
                Dim d As EXDICTCLIENTLibCtl.IDefinition
                Dim i As Long
                For i = 0 To r.Definitions.Count - 1
                    Set d = r.Definitions.Item(i)
                    Debug.Print d.Body
                Next
            Next
        End With
        c.Close
    End If
    Set c = Nothing
End Sub

The following sample does the same thing as previous except that enumerating the definitions in the Definitions collection is did using the for each statement:

Private Sub Form_Load()
    Dim c As EXDICTCLIENTLibCtl.Connection
    Set c = Client1.OpenConnection("dict.org")
    If Not (c Is Nothing) Then
        With c.CreateQuery("dog", , c.Strategies("exact"))
            Dim r As EXDICTCLIENTLibCtl.IResult
            For Each r In .Execute
                Debug.Print " Searching the '" & r.Word & "' in '" & r.Dictionary.Name & "' dictionary gets: "
                Dim d As EXDICTCLIENTLibCtl.IDefinition
                For Each d In r.Definitions
                    Debug.Print d.Body
                Next
            Next
        End With
        c.Close
    End If
    Set c = Nothing
End Sub


Dictionaries object
The Dictionaries object holds a collection of Dictionary objects. Use the Dictionaries property to access the Dictionaries collection available on the server. The Dictionaries object supports the following properties and methods:

Name | Description
Count | Number of items.
Item | Return an item from the collection. The key can be the name of the dictionary or an index.


property Count

property Dictionaries.Count as Long
Number of items.

Type | Description
Long | A long expression that indicates the number of Dictionary objects in the Dictionaries collection.

The Count property counts the elements in the collection. Use the Item property to access a given Dictionary object.


property Item

property Dictionaries.Item (key as Variant) as Dictionary
Return an item from the collection. The key can be the name of the dictionary or an index.

Type | Description
key as Variant | A long expression that indicates the index of the dictionary in the collection, a string expression that indicates the name of the dictionary.
Dictionary | A Dictionary object being returned.

Use the Item property to access a Dictionary object. The Count property counts the number of items in the collection. Use the Dictionaries properties to access the server's available dictionaries. The Item property is the default property for the Dictionaries object so the following statements are equivalents:

Dictionaries.Item(i)

or

Dictionaries(i)

The following sample displays the dictionaries available on the server ( the sample enumerates the collection of dictionaries, using the for each statement ):

Private Sub Form_Load()
    Dim c As EXDICTCLIENTLibCtl.Connection
    Set c = Client1.OpenConnection("dict.org")
    If Not (c Is Nothing) Then
        Dim d As EXDICTCLIENTLibCtl.IDictionary
        For Each d In c.Dictionaries
            Debug.Print d.Name & " " & d.Description
        Next
        c.Close
    End If
    Set c = Nothing
End Sub

The following sample prints all dictionaries available on the server ( the sample enumerates the collection of dictionaries, using the Item and Count properties ):

Private Sub Form_Load()
    Dim c As EXDICTCLIENTLibCtl.Connection
    Set c = Client1.OpenConnection("dict.org")
    If Not (c Is Nothing) Then
        Dim d As EXDICTCLIENTLibCtl.IDictionary
        Dim i As Long
        For i = 0 To c.Dictionaries.Count - 1
            Set d = c.Dictionaries.Item(i)
            Debug.Print d.Name & " " & d.Description
        Next
        c.Close
    End If
    Set c = Nothing
End Sub


Dictionary object
The Dictionary object holds information about a dictionary. Use the Dictionaries property to access the list of available dictionaries on the server. The Dictionary object supports the following properties and methods:

Name | Description
Description | Short description of the dictionary.
Details | Dictionary details.
Name | Name of the dictionary.


property Description

property Dictionary.Description as String
Short description of the dictionary.

Type | Description
String | A string expression that specifies the short description of the dictionary.

The Description property gets a short description of the dictionary. Use the Name property to get the dictionary's name. Use the Details property to get details about a dictionary.


property Details

property Dictionary.Details as String
Dictionary details.

Type | Description
String | A string expression that describes details about the dictionary.

The Description property gets a short description of the dictionary. Use the Name property to get the dictionary's name. Use the Details property to get details about a dictionary.


property Name

property Dictionary.Name as String
Name of the dictionary.

Type | Description
String | A string expression that defines the dictionary's name.

The Description property gets a short description of the dictionary. Use the Name property to get the dictionary's name. Use the Details property to get details about a dictionary.


LineStream object
The LineStream object helps you to send custom commands to the server. Use the LineStream property to access the LineStream object of the client. The LineStream object supports the following properties and methods:

Name | Description
ReadLine | Reads a line of text from stream.
WriteLine | Writes a line of text to stream.


method ReadLine

method LineStream.ReadLine ()
Reads a line of text from stream.

Type Description
Return | Description
String | A string expression that indicates the line.
Use the ReadLine method to get the answer of the server line by line, after sending a custom command. Use the WriteLine property to send custom commands to the server. Use the LineStream property to access the LineStream object.

The following sample sends the "show db" command to the server, and gets the results:

Private Sub Form_Load()
    Dim c As EXDICTCLIENTLibCtl.Connection
    Set c = Client1.OpenConnection("dict.org")
    If Not (c Is Nothing) Then
        With c.LineStream
            .WriteLine "show db"
            Dim bContinue As Boolean
            bContinue = True
            While bContinue
                Dim s As String
                s = .ReadLine
                If (s = ".") Then
                    bContinue = False
                End If
                Debug.Print s
            Wend
        End With
        c.Close
    End If
    Set c = Nothing
End Sub

The sample sends the "show db" command to the server and gets the answer that server sends to the command, line by line until the server sends the '.' line. The "show db" command displays the list of currently accessible databases, one per line.


method WriteLine

method LineStream.WriteLine (line as String)
Writes a line of text to stream.

Type | Description
line as String | A string expression that indicates the custom command as described in the RFC 2229.
Use the WriteLine property to send custom commands to the server. Use the ReadLine method to get the answer of the server line by line. Use the LineStream property to access the LineStream object. The following sample sends the "show db" command to the server, and gets the results:
Private Sub Form_Load()
    Dim c As EXDICTCLIENTLibCtl.Connection
    Set c = Client1.OpenConnection("dict.org")
    If Not (c Is Nothing) Then
        With c.LineStream
            .WriteLine "show db"
            Dim bContinue As Boolean
            bContinue = True
            While bContinue
                Dim s As String
                s = .ReadLine
                If (s = ".") Then
                    bContinue = False
                End If
                Debug.Print s
            Wend
        End With
        c.Close
    End If
    Set c = Nothing
End Sub

The sample sends the "show db" command to the server and gets the answer that server sends to the command, line by line until the server sends the '.' line. The "show db" command displays the list of currently accessible databases, one per line.


Query object
The Query object holds information being sent to the server. Use the CreateQuery property to prepare a Query object. The Query object supports the following properties and methods:

Name | Description
Connection | Connection object that has created this query object.
Dictionary | Dictionary of this query.
Execute | Execute the query.
expression | Expression of this query.
strategy | Strategy of this query.


property Connection

property Query.Connection as Connection
Connection object that has created this query object.

Type | Description
Connection | A Connection object that has created the Query object.

Use the CreateQuery property to create a Query object. The Connection property gets the Connection object the has created the query. Use the Execute method to execute a query ( sends it to the server ).


property Dictionary

property Query.Dictionary as Dictionary
Dictionary of this query.

Type | Description
Dictionary | A Dictionary object being queried about the expression.

Use the CreateQuery property to creates a query based on a dictionary and a strategy. The Dictionary property defines the Dictionary object being queried. Use the Execute method to send a query to a server.


method Execute

method Query.Execute ()
Execute the query.

Type Description
Return | Description
Results | A Results object that holds the answer of the server to the client's query.

Use the CreateQuery property to prepare a query to be sent to a server. Use the Execute method to send the query to the server. Use the Definitions property to access the definitions for the expression. Use the Body property to get a specific definition.

The following sample queries the "dict.org" server for all definitions for "hot" expression. ( The sample uses the "exact" strategy, but asks all available dictionaries ):

Private Sub Form_Load()
    Dim c As EXDICTCLIENTLibCtl.Connection
    Set c = Client1.OpenConnection("dict.org")
    If Not (c Is Nothing) Then
        With c.CreateQuery("hot", , c.Strategies("exact"))
            Dim r As EXDICTCLIENTLibCtl.IResult
            For Each r In .Execute
                Dim d As EXDICTCLIENTLibCtl.IDefinition
                For Each d In r.Definitions
                    Debug.Print d.Body
                Next
            Next
        End With
        c.Close
    End If
    Set c = Nothing
End Sub


property expression

property Query.expression as String
Expression of this query.

Type | Description
String | A string expression that indicates the expression of the query.

The Expression property specifies the query's expression. Use the CreateQuery method to prepare a query.


property strategy

property Query.strategy as Strategy
Strategy of this query.

Type | Description
Strategy | A Strategy object being used to query the server.

Use the CreateQuery property to prepare a query to be sent to a server. The Strategy property defines the strategies used when queried the server for an expression. The Strategy property is identical with the Strategy parameter of the CreateQuery method.

The following sample queries the "dict.org" server for all definitions for "hot" expression. ( The sample uses the "exact" strategy, but asks all available dictionaries ):

Private Sub Form_Load()
    Dim c As EXDICTCLIENTLibCtl.Connection
    Set c = Client1.OpenConnection("dict.org")
    If Not (c Is Nothing) Then
        With c.CreateQuery("hot", , c.Strategies("exact"))
            Dim r As EXDICTCLIENTLibCtl.IResult
            For Each r In .Execute
                Dim d As EXDICTCLIENTLibCtl.IDefinition
                For Each d In r.Definitions
                    Debug.Print d.Body
                Next
            Next
        End With
        c.Close
    End If
    Set c = Nothing
End Sub


Result object
The Result object holds the definitions for an expression within a dictionary. Use the Execute method to access the Results object. The Result object supports the following properties and methods:

Name | Description
Definitions | Definitions for a word.
Dictionary | Dictionary from which the word definition was retrieved.
Word | Word for which the definition is provided.


property Definitions

property Result.Definitions as Definitions
Definitions for a word.

Type | Description
Definitions | A Definitions object that holds a collection of Definition objects.

Use the Definitions property to access to the expression's definitions available on the server. Use the Execute method to access the Result object. The Result object holds the answer of the server to the client's query.

The following sample displays all definitions for "dog" expression:

Private Sub Form_Load()
    Dim c As EXDICTCLIENTLibCtl.Connection
    Set c = Client1.OpenConnection("dict.org")
    If Not (c Is Nothing) Then
        With c.CreateQuery("dog")
            Dim r As EXDICTCLIENTLibCtl.IResult
            For Each r In .Execute
                Debug.Print " Searching the '" & r.Word & "' in '" & r.Dictionary.Name & "' dictionary gets: "
                Dim d As EXDICTCLIENTLibCtl.IDefinition
                For Each d In r.Definitions
                    Debug.Print d.Body
                Next
            Next
        End With
        c.Close
    End If
    Set c = Nothing
End Sub


property Dictionary

property Result.Dictionary as Dictionary
Dictionary from which the word definition was retrieved.

Type | Description
Dictionary | A Dictionary object that holds information about a dictionary.

The Dictionary property retrieves the dictionary where the definition is found. Use the Dictionaries property to get the list of available dictionaries on the server.

The following sample displays the dictionaries where the "dog" expression is found:

Private Sub Form_Load()
    Dim c As EXDICTCLIENTLibCtl.Connection
    Set c = Client1.OpenConnection("dict.org")
    If Not (c Is Nothing) Then
        With c.CreateQuery("dog")
            Dim r As EXDICTCLIENTLibCtl.IResult
            For Each r In .Execute
                Debug.Print " The '" & r.Word & "' found on '" & r.Dictionary.Name & "'."
            Next
        End With
        c.Close
    End If
    Set c = Nothing
End Sub

The sample displays the results in the output window like follows:

The 'dog' found on 'web1913'.
The 'Dog' found on 'web1913'.
The 'dog' found on 'wn'.
The 'Dog' found on 'easton'.
The 'DOG' found on 'devils'.


property Word

property Result.Word as String
Word for which the definition is provided.

Type | Description
String | A string expression that defines the word.

Use the CreateQuery method to prepare a query. The Word property is identical with the Expression parameter of the CreateQuery method.


Results object
The Results object holds a collection of Result objects. Each Result object holds a list of available definition on a specified dictionary. Use the Execute method to send a query to a server. The Execute method gets the results in a Results object. The Results object supports the following properties and methods:

Name | Description
Count | Number of items in the collection.
Item | Returns an item within the collection. The key is the index of the item.


property Count

property Results.Count as Long
Number of items in the collection.

Type | Description
Long | A long expression that indicates the number of elements in the Results collection.

The Count property counts the number of Result objects in the Results collection. Use the Item property to access a specific Result object.


property Item

property Results.Item (key as Long) as Result
Returns an item within the collection. The key is the index of the item.

Type | Description
key as Long | A long expression that indicates the index of the result in the Results collection.
Result | A Result object being accessed.

Use the Item property to access a Result object. Use the Execute method to get a Results collection. The Item property is the default property for the Results object so the following statements are equivalents:

Results.Item(i)

or

Results(i)

The following sample displays all dictionaries where we can found a definition for the "chart" expression:

Private Sub Form_Load()
    Dim c As EXDICTCLIENTLibCtl.Connection
    Set c = Client1.OpenConnection("dict.org")
    If Not (c Is Nothing) Then
        With c.CreateQuery("chart")
            Dim r As EXDICTCLIENTLibCtl.IResult
            For Each r In .Execute
                Debug.Print " The '" & r.Word & "' found on '" & r.Dictionary.Name & "'."
            Next
        End With
        c.Close
    End If
    Set c = Nothing
End Sub


Strategies object
The Strategies object holds a collection of Strategy objects. Use the Strategies property to get the list of available strategies on the server. The Strategies object supports the following properties and methods:

Name | Description
Count | Number of items in the collection.
Item | Return an item within the collection. The key can be the name of the strategy or an index.


property Count

property Strategies.Count as Long
Number of items in the collection.

Type | Description
Long | A long expression that indicates the number of Strategy objects in the Strategies collection.

The Count property counts the number of the elements in the Strategies collection. Use the Item property to access a specific Strategy object.


property Item

property Strategies.Item (key as Variant) as Strategy
Return an item within the collection. The key can be the name of the strategy or an index.

Type | Description
key as Variant | A long expression that indicates the index of strategy in the collection, a string expression that indicates the name of the strategy.
Strategy | A Strategy object that holds the strategy

Use the Item property to access a strategy. Use the Strategies property to get the list of available strategies on the server. The Count property counts the elements in the collection. The Item property is the default property of the Strategies collection so the following statements are equivalents:

Strategies.Item(i)

or

Strategies(i)


Strategy object
The Strategy object contains a strategy available on the server. Use the Strategies property to access the list of available strategies on the server. The Strategy object supports the following properties and methods:

Name | Description
Description | Description for the strategy.
Name | Name of the strategy.


property Description

property Strategy.Description as String
Description for the strategy.

Type | Description
String | A string expression that indicates the description for a strategy.

The Description property indicates the strategy's description.

The following sample displays all strategies available on the server:

Private Sub Form_Load()
    Dim c As EXDICTCLIENTLibCtl.Connection
    Set c = Client1.OpenConnection("dict.org")
    If Not (c Is Nothing) Then
        Dim s As EXDICTCLIENTLibCtl.IStrategy
        For Each s In c.Strategies
            Debug.Print "The description for '" & s.Name & "' strategy is '" & s.Description & "'."
        Next
        c.Close
    End If
    Set c = Nothing
End Sub

The sample displays the strategies in the output window like follows:

The description for 'exact' strategy is 'Match words exactly'.
The description for 'prefix' strategy is 'Match prefixes'.
The description for 'substring' strategy is 'Match substring occurring anywhere in word'.
The description for 'suffix' strategy is 'Match suffixes'.
The description for 're' strategy is 'POSIX 1003.2 (modern) regular expressions'.
The description for 'regexp' strategy is 'Old (basic) regular expressions'.
The description for 'soundex' strategy is 'Match using SOUNDEX algorithm'.
The description for 'lev' strategy is 'Match words within Levenshtein distance one'.


property Name

property Strategy.Name as String
Name of the strategy.

Type | Description
String | A string expression that indicates the name of the strategy.
The following sample displays all strategies available on the server:
Private Sub Form_Load()
    Dim c As EXDICTCLIENTLibCtl.Connection
    Set c = Client1.OpenConnection("dict.org")
    If Not (c Is Nothing) Then
        Dim s As EXDICTCLIENTLibCtl.IStrategy
        For Each s In c.Strategies
            Debug.Print "The description for '" & s.Name & "' strategy is '" & s.Description & "'."
        Next
        c.Close
    End If
    Set c = Nothing
End Sub

The sample displays the strategies in the output window like follows:

The description for 'exact' strategy is 'Match words exactly'.
The description for 'prefix' strategy is 'Match prefixes'.
The description for 'substring' strategy is 'Match substring occurring anywhere in word'.
The description for 'suffix' strategy is 'Match suffixes'.
The description for 're' strategy is 'POSIX 1003.2 (modern) regular expressions'.
The description for 'regexp' strategy is 'Old (basic) regular expressions'.
The description for 'soundex' strategy is 'Match using SOUNDEX algorithm'.
The description for 'lev' strategy is 'Match words within Levenshtein distance one'.