home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-04-11 | 36.2 KB | 1,001 lines |
-
-
-
-
-
- The Electronic Alveary
-
- A word match program for crossword solvers and setters
-
-
-
- by
-
- Ross Beresford
-
-
-
- Version 1.00
-
- 12th April 1992
-
-
-
- Copyright (c) J Ross Beresford 1992
-
- All Rights Reserved
-
-
-
-
-
- The Electronic Alveary is a FREEWARE
- package: it can be freely copied and
- distributed under the terms of the
- licensing agreement at the end of
- this document.
-
-
-
-
-
-
-
-
-
- The program author can be reached on the following systems:
-
- CIX
- Phone +44 81 399 5252
- Account name rberesfo
- Internet address rberesfo@cix.compulink.co.uk (preferred)
- rberesfo%cix@uknet.ac.uk (if above fails)
-
-
- Golly!
- Phone +44 734 320812
- Account name Ross Beresford
- Fidonet address 2:252/21
- Internet address ross.beresford@f21.n252.z2.fidonet.org
-
-
- MANIFEST
- --------
-
- This release of TEA should contain the following files:
-
- READ.ME Quick start document
- TEA100.DOC This manual
- TEA.EXE The TEA pattern matching program
- TEA.RSC The default (colour) configuration file
- COLOUR.RSC Colour screen configuration file
- MONO.RSC Monochrome screen configuration file
- WORDS.nn TEA database files
-
- A compression program that builds TEA database files from an
- ASCII word list is distributed separately as TEABDnnn.ZIP,
- where nnn is the version number. This includes 'C' source and
- an MS-DOS binary.
-
-
- CONTENTS
- --------
-
- 1. Introduction
- 2. Interactive Mode
- 3. Command Line Mode
- 4. Patterns
- 5. Controls
- Appendix A. Messages
- Appendix B. Video Modes
- Appendix C. Resource File
- Appendix D. Release History
- Appendix E. Licensing Information
-
-
- 1. INTRODUCTION
- ------------
-
- TEA can be run in either command line mode or interactive
- mode.
-
- The first two sections give information about how to use TEA
- in each of these modes.
-
- The remaining sections describe the underlying functionality
- of TEA which is the same for both modes.
-
- 2. INTERACTIVE MODE
- ----------------
-
- In this mode, TEA runs continuously and its behaviour is
- controlled using a text mode user interface.
-
-
- TEA determines the colours used in the interactive mode
- display from a resource file. TEA is pre-configured for a
- colour screen. If you have a monochrome screen, make sure TEA
- uses the monochrome resource file before you start by typing:
-
- copy mono.rsc tea.rsc
-
- See "Appendix C. Resource File" for more information about the
- format of the resource file.
-
-
- To enter interactive mode, just type the name of the program:
-
- tea
-
- All the command line mode options may also be entered as
- options when starting interactive mode: they become the
- initial settings.
-
- By default, TEA assumes the dictionary database files are
- named WORDS.nn and are stored in the same directory as
- TEA.EXE. If you have moved the database files to a different
- directory, or renamed them, you must use the -d option to
- specify their path, for example:
-
- tea -d d:\dict\words
-
- Once TEA has started, you can begin to enter match patterns
- immediately. To exit TEA at this point, press Esc; pressing
- Ctrl-C or Ctrl-Break at any time will also cause TEA to exit.
-
- See the PATTERNS section for a description of the types of
- pattern that can be specified.
-
-
- Help: Once interactive mode has started, you can
- get help at any time by pressing F1.
- Pressing a key when the help screen is
- displayed returns you to the program.
-
-
- Field editing: The field being edited is displayed in a
- different colour. Characters can be entered
- at the cursor in the usual way.
-
- The Ins key toggles between insert and
- overwrite mode (the default is insert mode);
- the Left and Right arrow keys move the
- cursor along a field; Home and End move the
- cursor to the beginning and end of a field;
- Del deletes the character at the cursor.
-
- The Return key accepts a changed field; the
- Esc key causes any changes to be abandoned.
-
- Matching: The program starts matching when Return is
- pressed after the pattern has been edited.
-
- Matching can be paused by pressing any key.
- Pressing the space bar resumes the match;
- any other key aborts the match.
-
- While matching is paused, the output buffer
- can be scrolled, printed or written to a
- file.
-
-
- Scrolling output: If the matched output for a pattern
- overflows the output window, it is stored
- in a buffer up to a limit of 200 lines.
-
- This buffer can be scrolled: a line at a
- time using the Up and Down arrow keys; a
- page at a time using PgUp and PgDn; to the
- top using Ctrl-PgUp and to the bottom using
- Ctrl-PgDn.
-
-
- Printing output: To print the contents of the output buffer,
- use ALT-W and then press Return.
-
-
- Filing output: To dump the contents of the output buffer to
- a file, press ALT-W, enter the name of the
- file to be created and then press return.
-
- Note that the output buffer size is limited
- to 200 lines. If you want to dump large
- amounts of output (for example, all the
- words of a particular length), it is better
- to use command line mode and DOS file
- redirection.
-
-
- Editing controls: The options affecting pattern matching are
- displayed just above the pattern in the TEA
- main screen. They can be changed by pressing
- ALT with the letter highlighted in the
- option name. Press:
-
- ALT-S to change the shortest word length
- ALT-L to change the longest word length
- ALT-P to toggle the playfair filter setting
- ALT-A to change the alternate word filter
- ALT-I to change the included word filter
-
- See the CONTROLS section for a description
- of how the controls affect pattern matching.
-
-
- TEA tries to adapt to the active video mode when it starts up:
- if the active video mode is one it supports (see "Appendix B:
- Video Modes" for a list), then it continues to use that mode.
- If the active video mode isn't supported, TEA switches to mode
- 3 (colour 80 column mode).
-
- 3. COMMAND LINE MODE
- -----------------
-
- In this mode, TEA matches the single pattern specified on the
- command line, then exits. The output is displayed directly on
- the screen.
-
- This mode is used when -c is specified as an option. TEA's
- behaviour is controlled solely by the options and pattern
- specified on the command line.
-
- The command line syntax is as follows:
-
-
- tea [-h] [-d <database>] [-i <string>] [-a <string>] [-p]
- [-s <length>] [-l <length>] [-c] <pattern>
-
-
- -h prints usage information about TEA
-
-
- -d <database> instructs TEA to use the dictionary database
- files beginning with <database>.
-
- By default, TEA uses the dictionary database
- files beginning WORDS in the same directory
- as TEA.EXE.
-
- If you rename the dictionary database files,
- or store them in a different directory, you
- must specify this option so that TEA knows
- where to find them.
-
- For example, if the dictionary database files
- are called MYDICT.1, MYDICT.2 etc and are
- stored in D:\DICT, then specify:
-
- -d D:\DICT\MYDICT
-
-
- -i <string> instructs TEA to use <string> as the included
- word filter. See the CONTROLS section for
- information about how this affects pattern
- matching.
-
-
- -a <string> instructs TEA to use <string> as the
- alternate word filter. See the CONTROLS
- section for information about how this
- affects pattern matching.
-
-
- -p instructs TEA to set the playfair filter to
- ON (the default is OFF). See the CONTROLS
- section for information about how this
- affects pattern matching.
-
- -s <length> instructs TEA to set the shortest word length
- matched to <length>. See the CONTROLS section
- for information about how this affects
- pattern matching.
-
-
- -l <length> instructs TEA to set the longest word length
- matched to <length>. See the CONTROLS section
- for information about how this affects
- pattern matching.
-
-
- -c instructs TEA to use command line mode rather
- than interactive mode.
-
-
- <pattern> instructs TEA to print words matching
- <pattern>, which must be the last thing
- specified on the command line. See the
- PATTERNS section for a description of the
- types of pattern that can be used.
-
-
- The TEA output can be redirected to a file using standard
- MS-DOS output redirection. For example:
-
- tea -c .... > four.txt
-
- will write all the four letter words in the database into a
- file called FOUR.TXT, and:
-
- tea -c .a.e. > prn
-
- will output all the words matching the template -A-E- to the
- printer.
-
- 4. PATTERNS
- --------
-
- This section shows how to enter patterns that match the words
- you need, using examples of increasing complexity. The sample
- output given is based on the Webster's 2nd Edition word list.
-
-
-
- Simple templates:
-
- The simplest form of pattern is just a template with
- letters at the positions that must be matched and
- match-all characters at other positions.
-
- In the examples given in this section, '.' is used as
- the match-all character. In fact, TEA accepts any
- printable character that isn't otherwise used in the
- pattern syntax as a match-all character.
-
-
- tea -c ....
-
- lists all the four letter words, and
-
-
- tea -c m.nt.a
-
- lists all the words matching the template M-NT-A:
-
- mantra mantua Mentha Montia
-
-
-
- Templates with choice lists:
-
- If the character at a position in a word is known to be
- one of a set of letters, then this situation can be
- represented using a choice list.
-
- A choice list is entered by giving the list of possible
- letters between square brackets '[' and ']'. The complete
- choice list matches just one letter in the word.
-
-
- tea -c [abcd]ean
-
- lists the four letter words starting with either A, B,
- C or D and ending EAN:
-
- bean dean
-
-
- tea -c we[air]..er
-
- lists the 7 letter words starting with either WEA, WEI
- or WER and ending --ER:
-
- weanyer wearier weather weigher Werther
-
- Templates with wildcards:
-
- Gaps in the template that can be of variable length are
- indicated by the '*' wildcard. The '*' wildcard matches
- zero or more letters in the word. The use of wildcards
- implies that different lengths of words may be found.
-
-
- tea -c bluest*
-
- lists words of any length starting with BLUEST:
-
- bluestem bluestone blue-starry
- bluestoner blue-stained blue-stemmed
- blue-striped bluestocking blue star grass
- bluestockingish bluestockingism
-
-
- tea -c *robin*
-
- lists words of any length including ROBIN anywhere:
-
- Robin robin robing eurobin
- robinet Robinia robinin sea robin
- antirobin bush robin cock robin robin chat
- Robin hood wake-robin wood robin algarrobin
- beach robin marsh robin robinoside
- robin snipe round robin scare-robin
- scrub robin swamp robin chrysarobin
- ground robin robin dipper robin runaway
- robin accentor robin redbreast robin sandpiper
-
-
- tea -c *.boule.*
-
- lists words of any length including BOULE anywhere
- except the start and end of the word:
-
- upboulevard probouleutic proboulevard
- symbouleutic
-
- Simple anagrams:
-
- The place where the anagram part of a pattern begins is
- marked using a semicolon ';'. After the ';' character, the
- elements of the pattern can be matched in any order.
-
- tea -c ;easting
-
- lists all the anagrams of EASTING:
-
- easting gainset Genista genista
- ingesta seating signate teasing
-
-
- Anagrams can also include match-all characters. Like the
- anagram letters, they can be matched at any position in
- the word.
-
- tea -c ;string.
-
- lists all the words including the letters in STRING
- plus one arbitrary letter:
-
- gastrin G string resting staring
- stinger stringy
-
-
-
- Anagrams with choice lists:
-
- Choice lists can also be used in anagram patterns, when
- one of the constituent letters in the anagram isn't known
- exactly.
-
-
- tea -c ;br[au]sh
-
- lists the anagrams of BRUSH and BRASH:
-
- brash brush shrab shrub
-
-
-
- Anagrams with wildcards:
-
- Wildcards can also be used in anagram patterns, when the
- word being sought is known to contain a particular set of
- letters, but its exact length isn't known.
-
- tea -c ;abcdefg*
-
- lists the words of any length including all the
- letters A-G:
-
- back-fanged bright-faced
- black-figured cartridge buff
- deflecting bar bleaching field
- boarding officer comb-fringed grass
- double-refracting proficiency badge
- Black-faced highland vertical lift bridge
- green-backed goldfinch
-
- Combined templates and anagrams:
-
- A template and anagram can be used together. A ';' marks
- the boundary between the template part of the pattern and
- the anagram part of the pattern.
-
- tea -c ..a....;easting
-
- lists the anagrams of EASTING that also match the
- template --A----:
-
- seating teasing
-
-
- The number of letter positions specified in the template
- and anagram do not have to agree. When the anagram has
- more letters than the template, only the number of letters
- required for the template need to be matched from the
- anagram part.
-
- tea -c ....;beard
-
- lists all the words that can be made up from 4 out of
- the 5 letters of BEARD:
-
- abed ared bade bard Bare bare bead
- bear brad brae bred daer dare dear
- drab read
-
-
- If the template includes a wildcard, then the range of
- word lengths from the smallest length implied by the
- template to the length implied by the anagram is treated
- as above.
-
-
- tea -c .........*;sportscaster
-
- lists all the words of 9 letters or more that can be
- made up of the letters in SPORTSCASTER:
-
- attercrop cross seat cross-star
- pastoress prostrate Sarcoptes
- spectator tapstress cross strap
-
-
- When the anagram has fewer letters than the template, the
- anagram is automatically padded with match-all characters
- to the length of the template.
-
- tea -c .......w;krs
- tea -c .......w;krs*
- tea -c .......w;krs.....
-
- are all equivalent and list the 8 letter words ending
- W and including the letters K, R and S anywhere along
- their length:
-
- rickshaw stark-new
-
- Sub-patterns:
-
- Sub-patterns can also be used as a match element within
- the template or anagram part of a pattern. Sub-patterns
- are surrounded with round brackets '(' and ')'.
-
-
- If a sub-pattern is specified as part of the template, the
- sub-pattern is matched at the exact position within the
- template. The usual reason for doing this is to include an
- anagram specification within a template.
-
- tea -c .(;reed).
-
- lists the 6 letter words that have an anagram of REED
- as the middle 4 letters:
-
- breedy greedy Hedera herder
- teredo verdea verdet
-
-
- If the sub-pattern is specified as part of the anagram,
- then the sub-pattern can AS A UNIT be matched anywhere in
- a word. This is useful when a word is known to contain a
- particular sequence of letters, but where the exact
- position isn't known:
-
- tea -c .a.........er;(and)
-
- lists the 13 letter words that match the template
- -A---------ER and include the letters AND together, at
- any position in the word:
-
- candlelighter candle snuffer
- garland flower landing waiter
- Pan-afrikander salt-and-pepper
- wall germander
-
-
- The above examples just scrape the surface of the sorts of
- patterns it is possible to specify. All the components of
- a pattern:
-
- letters
- match-all characters
- choice lists
- wild cards
- sub-patterns
-
- can be used as often as necessary in the template and/or
- anagram parts of a pattern. Sub-patterns can include other
- sub-patterns to the depth required.
-
-
- 5. CONTROLS
- --------
-
-
- This section describes the controls that affect the matching
- process in addition to the pattern.
-
- In interactive mode, the control settings are displayed above
- the pattern. They keep their value until they are changed by
- pressing ALT-letter, where letter is the highlighted letter
- in the control name.
-
- In command line mode, the control settings are specified using
- options on the command line.
-
-
- Shortest word These controls determine the shortest and
- Longest word longest words that will be considered for
- matching.
-
- In interactive mode, use ALT-S and ALT-L to
- change the values.
-
- In command line mode, using -s <length> and -l
- <length> on the command line to set the
- values.
-
-
- Included word This control is a filter that is applied after
- normal pattern matching.
-
- If an included word string is specified, only
- words included in the string either forwards
- or backwards will be output.
-
- In interactive mode, use ALT-I to change the
- included word string.
-
- In command line mode, use -i <string> to set
- the included word string.
-
- This control is mostly used with a pattern of
- *, for example:
-
- tea -c -i gutter -s 3 *
-
- will list all the words of three or more
- letters that are contained in GUTTER, either
- forwards or reversed.
-
- Alternate word This control is a filter that is applied after
- normal pattern matching.
-
- If an alternate word string is specified, only
- words that include the letters in the string
- specified as alternate letters will be output.
-
- In interactive mode, use ALT-A to change the
- alternate word string.
-
- In command line mode, use -a <string> to set
- the alternate word string.
-
- This control is mostly used with a pattern of
- *, for example:
-
- tea -c -a isle *
-
- will list all the words that contain the
- letters I S L E as alternate letters. It is
- equivalent to specifying:
-
- tea -c -l 8 *i.s.l.e*
-
-
- Playfair This control is a filter that is applied after
- normal pattern matching.
-
- If the playfair filter is ON, only words that
- are usable as a playfair key word are output.
-
- (Playfair codes are employed fairly frequently
- in British thematic cryptic puzzles. Only
- words that have no repeating letters and don't
- include a 'j' are allowable playfair
- codewords.)
-
- In interactive mode, use ALT-P to toggle the
- state of the playfair filter between OFF and
- ON.
-
- In command line mode, specify -p to set the
- playfair filter to ON. The default is OFF.
-
- This control is mostly used with a pattern of
- *, for example:
-
- tea -c -p -s 12 *
-
- lists all the words of 12 letters and over
- that could be used as a Playfair codeword.
-
- Appendix A. MESSAGES
- --------
-
- This section lists the error messages that TEA can produce and
- describes how to correct them:
-
-
- Couldn't find the data files
-
- TEA prints this error message if it can't find any
- dictionary database files to use.
-
- If you specified -d on the command line, you may have
- entered the wrong path for <database>. Remember to
- specify the file prefix, leaving off the numbered file
- suffixes, for example:
-
- -d D:\DICT\MYDICT
-
- If you didn't specify -d on the command line, then you
- may need to if the database files are in a different
- directory to TEA.EXE or called something different to
- WORDS.nn.
-
-
- ERROR: option -X requires an argument
-
- Add a parameter value following -d, -i, -a, -s or -l
- (for example a <length> or a <string>).
-
-
- ERROR: option -X unrecognised
-
- An option has been entered which TEA does not
- understand. Study the usage information to find out
- what went wrong.
-
-
- Edit the pattern, then press Return (Press F1 for more help)
-
- This message is displayed in interactive mode when TEA
- is ready for you to edit the pattern. Type in
- characters to edit the pattern, then press Return to
- start matching.
-
-
- Error during printing
-
- This message is displayed in interactive mode when TEA
- fails to print the output buffer completely. The
- problem is usually that the printer is not plugged
- into the computer, not switched on, not on-line or
- that it has run out of paper.
-
- Error occurred during file output
-
- This message is displayed in interactive mode when TEA
- fails to write the output to a file completely. The
- problem is usually that the disk you are using is
- full.
-
-
- Filename (leave blank to print):
-
- This message is displayed in interactive mode when you
- press ALT-W. At this point you should press Return to
- print the output buffer, or enter a file name to dump
- the output buffer to a file.
-
-
- Output file could not be opened
-
- This message is displayed in interactive mode when TEA
- failed to create the output file specified after ALT-W
- has been pressed. The problem is usually that a drive
- or directory specified does not exist, or that the
- file name contains invalid characters.
-
-
- Output to file completed successfully
-
- This message is displayed in interactive mode when TEA
- has written the complete output buffer without
- encountering any problems.
-
-
- PAUSED: Press SPACE to resume
-
- This message is displayed in interactive mode when a key
- is pressed while TEA is matching a pattern. At this
- point you can scroll through or write the output that
- has already appeared. You can press the space bar to
- resume the matching process. Any other key aborts the
- matching process, and you resume editing the pattern.
-
-
- Pattern Syntax Error: choice list not terminated by ]
-
- This message is displayed when the pattern includes a
- choice list [ character that doesn't have a
- corresponding ] character. Choice list brackets must
- be specified in matching pairs.
-
-
- Pattern Syntax Error: choice list terminator without matching [
-
- This message is displayed when the pattern includes a ]
- without a preceding [ to match it. Choice list
- brackets must be specified in matching pairs.
-
- Pattern Syntax Error: invalid characters in [] choice list
-
- This message is displayed when non-alphabetic
- characters are specified inside choice list brackets.
- It is only meaningful to include alphabetic characters
- inside a choice list.
-
-
- Pattern Syntax Error: more than one ; in pattern
-
- This message is displayed when a pattern or
- sub-pattern contains more than one ';' character.
- Since this character separates the left (template) and
- right (anagram) parts of a pattern, it is incorrect to
- have more than one in a pattern.
-
-
- Pattern Syntax Error: subpattern not terminated by )
-
- This message is displayed when the pattern includes a
- sub-pattern ( character that doesn't have a
- corresponding ) character. Sub-pattern brackets must
- be specified in matching pairs.
-
-
- Pattern Syntax Error: subpattern terminator without matching (
-
- This message is displayed when the pattern includes a )
- without a preceding ( to match it. Sub-pattern
- brackets must be specified in matching pairs.
-
-
- Pattern Syntax Error: too many characters in template
-
- This message is displayed in command line mode when
- a template is 80 characters or more long. The program
- cannot match words of that length.
-
-
- Printing completed successfully
-
- This message is displayed in interactive mode when TEA
- has printed the complete output buffer without
- encountering any problems.
-
-
- SEARCHING: Press any key to pause
-
- This message is displayed in interactive mode when TEA
- is in the middle of matching a pattern. Pressing any
- key at this point will pause the match, allowing you
- to browse the output or resume editing the pattern.
-
- Appendix B. VIDEO MODES
- -----------
-
- TEA supports the following video modes in interactive mode:
-
- Mode 2 Black and white, 80 columns
- Mode 3 Colour, 80 columns
- Mode 7 Monochrome, 80 columns
- Mode 64 EGA 43 line, or VGA 50 line
-
- If you want to use a particular mode, set it up before
- starting the program.
-
-
- Appendix C. RESOURCE FILE
- -------------
-
- TEA decides what colours to use for various parts of the
- display from the resource file named TEA.RSC in the directory
- containing TEA.EXE.
-
- The default resource file provided with the package is
- configured for colour screens. A resource file suitable for
- monochrome screens is provided in MONO.RSC. A copy of the
- default colour resource file is provided in COLOUR.RSC.
-
- To change to the monochrome resource file, type:
-
- copy mono.rsc tea.rsc
-
- To change the colours used on a colour display, edit the
- TEA.RSC file using the information about the format given
- below.
-
-
- The resource file includes a list of names that describe a
- part of the screen, together with a number defining the colour
- that will be displayed there.
-
- The following table shows the names of the resources and the
- range of values allowable for the resource:
-
- DefaultWindowForeground 0-7
- DefaultWindowBackground 0-15
- EditWindowForeground 0-15
- EditWindowBackground 0-15
- StatusWindowForeground 0-15
- StatusWindowBackground 0-15
- OutputWindowForeground 0-15
- OutputWindowBackground 0-15
- HelpWindowForeground 0-7
- HelpWindowBackground 0-15
-
- The significance of the numbers for the foreground colour
- resources is as follows:
-
- 0 Black
- 1 Blue
- 2 Green
- 3 Cyan
- 4 Red
- 5 Magenta
- 6 Brown
- 7 Light Grey
- 8 Dark Grey
- 9 Light Blue
- 10 Light Green
- 11 Light Cyan
- 12 Light Red
- 13 Light Magenta
- 14 Yellow
- 15 White
-
- The significance of the numbers for the background colour
- resources is as follows:
-
- 0 Black
- 1 Blue
- 2 Green
- 3 Cyan
- 4 Red
- 5 Magenta
- 6 Brown
- 7 Light Grey
- 8 Black )
- 9 Blue )
- 10 Green )
- 11 Cyan ) with foreground blinking
- 12 Red )
- 13 Magenta )
- 14 Brown )
- 15 Light Grey )
-
- Appendix D. RELEASE HISTORY
- ---------------
-
-
- TEA100: Version 1.00 - 12th April 1992
-
- This is the first full release of TEA for the MS-DOS
- platform. It will be distributed worldwide via SIMTEL
- and directly to UK bulletin boards.
-
-
- Appendix E. LICENSING INFORMATION
- ---------------------
-
- Copyright (c) J Ross Beresford 1992. All Rights Reserved.
-
- Commercial distribution and/or use is prohibited without prior
- written permission.
-
- Non-Commercial distribution and/or use is permitted under the
- following terms:
-
- You may copy and distribute verbatim copies of the TEA
- executable code and documentation as you receive it, in any
- medium, provided that you conspicuously and appropriately
- publish on each copy a valid copyright notice "Copyright (c) J
- Ross Beresford 1992", and keep intact the notices on all files
- that refer to these Licensing Terms and to the absence of any
- warranty.
-
- You may charge a distribution fee for the physical act of
- transferring a copy, but no more than is necessary to recover
- your actual costs incurred in the transfer.
-
- NO WARRANTY. Because TEA is licensed free of charge, there is
- absolutely no warranty. Except when otherwise stated in
- writing, TEA is provided "as is" without warranty of any kind,
- either expressed or implied, including but not limited to, the
- implied warranties of merchantability and fitness for a
- particular purpose. The entire risk as to the quality and
- performance of TEA, and the accuracy of its associated
- documentation, is with you.
-