File: webster

package info (click to toggle)
epic 3.004-17.1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 5,192 kB
  • ctags: 3,197
  • sloc: ansic: 40,843; makefile: 530; sh: 129; perl: 17
file content (97 lines) | stat: -rw-r--r-- 2,250 bytes parent folder | download | duplicates (15)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/*
 * A webster client for ircII
 * Written by Jeremy Nelson (C) 1994 - This is Freeware
 *
 * This script requires ircII-EPIC to run.
 * Since there is no more webster server, this script stands
 * as an intellectual exercise.
 */
echo *** The webster server at webster.cs.indiana.edu 
echo *** is no longer operational.  The webster script
echo *** is obsolete.

alias define {
	webster.connect
	webster.out DEFINE $0
}
alias complete {
	webster.connect
	webster.out COMPLETE $0
}
alias endings {
	webster.connect
	webster.out ENDINGS $0
}
alias spell {
	webster.connect
	webster.out SPELL $0
}
alias webster.out {
	dcc raw $webster.fd $webster.host $*$chr(13)$chr(10)
}
alias webster.connect {
	^set display off
        echo *** Webster: Hang on.....
	@ webster.host = [webster.cs.indiana.edu]
	@ webster.port = 2627
	@ webster.fd = connect($webster.host $webster.port)
	if (webster.fd)
	{
		eval ^on ^dcc_raw "$webster.fd $webster.host D *" {
			hook WEBSTER $strip($chr(13) $3-)
		}
	}
	{
		echo *** Webster: connection failed
	}
	^set display on
}

# The DEFINE command replies
on hook "WEBSTER DEFINITION 0" {
	echo *** Webster: Definition Found.
}
on hook "WEBSTER DEFINITION %" {
	echo *** Webster: There are $2 cross references for this word
}
on hook "WEBSTER WILD" {
	echo *** Webster: These words match the pattern.
}
on hook "WEBSTER WILD 0" {
	echo *** Webster: No words match this pattern.
}
on hook "WEBSTER ERROR*" {
	echo *** Webster: Error: unknown command. Ack!
}

# The COMPLETE command replies
on hook "WEBSTER AMBIGUOUS %" {
	echo *** Webster: There are $2 possible completions to the word.
}
on hook "WEBSTER COMPLETION %" {
	echo *** Webster: Try completing the word as $2.
}

# The ENDINGS command replies
on hook "WEBSTER MATCHS 0" {
	echo *** Webster: No words begin with that prefix
}
on hook "WEBSTER MATCHS" {
	echo *** Webster: These words complete that suffix
}

# The SPELL command replies
on hook "WEBSTER SPELLING 0" {
	echo *** Webster: I have NO idea how to spell that word
}
on hook "WEBSTER SPELLING 1" {
	echo *** Webster: That word is spelled correctly
}
on hook "WEBSTER SPELLING" {
	echo *** Webster: Try using one of these words instead
}

# Everything else gets echoed
on hook "WEBSTER *" {
	echo $1-
}