I think I may have figured out enough of the #KWIC source code to understand the...
Phil @philcowans@universeodon.com
I think I may have figured out enough of the #KWIC source code to understand the input, which might mean I can have a go at running it soon. It uses two input tapes:
JOBTP - I think this is just a comma separated list of stop words (words to ignore when indexing), with a full stop (period) at the end to tell the parser when to stop.
INPTP - The actual records to be indexed. This uses various different types of cards, identified by a single digit in column 80. The card classes are:
3 - Author name and initials.
4 - Main text to be indexed for record.
5 - A year, maybe publication date.
2 - End of record card, but I think it also includes an index number.
1 - End of file
There's a very complex finite state machine (see image) determining the permitted translations between the card types. Type 4 input can span multiple cards, and I think you can have multiple instances of type 3 and 5, but I have no idea why you'd want to do that - I think it just ignores everything apart from the last card of that type which it encounters.
All four field parsing routines also use finite state machines - I guess in a sense precursors to regular expressions. Quite a bit of duplicated code.