dict

package
v0.0.0-...-0d01ef4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 17, 2015 License: BSD-1-Clause Imports: 8 Imported by: 0

README

Dict

This plugin provides dictionary lookups for a given word. It uses the dict.org API for this purpose.

Commands

  • define <term>: Fetches the definition for the given term from a dictionary and presents it to the channel or user from wence the request came.

Documentation

Overview

Package dict implements the Dictionary Server Protocol as defined in RFC 2229.

This plugin provides dictionary lookups for a given word.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(profile string) plugin.Plugin

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

A Client represents a client connection to a dictionary server.

func Dial

func Dial(network, addr string) (*Client, error)

Dial returns a new client connected to a dictionary server at addr on the given network.

func (*Client) Close

func (c *Client) Close() error

Close closes the connection to the dictionary server.

func (*Client) Define

func (c *Client) Define(dict, word string) ([]*Defn, error)

Define requests the definition of the given word. The argument dict names the dictionary to use, the Name field of a Dict returned by Dicts.

The special dictionary name "*" means to look in all the server's dictionaries. The special dictionary name "!" means to look in all the server's dictionaries in turn, stopping after finding the word in one of them.

func (*Client) Dicts

func (c *Client) Dicts() ([]Dict, error)

Dicts returns a list of the dictionaries available on the server.

type Defn

type Defn struct {
	Dict Dict   // Dict where definition was found
	Word string // Word being defined
	Text []byte // Definition text, typically multiple lines
}

A Defn represents a definition.

type Dict

type Dict struct {
	Name string // short name of dictionary
	Desc string // long description
}

A Dict represents a dictionary available on the server.

type Plugin

type Plugin struct {
	*plugin.Base
}

func (*Plugin) Load

func (p *Plugin) Load(c *proto.Client) (err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL