next up previous
Next: Importer Up: Design of Modules Previous: Design of Modules

Key-Tagger



The tagger expects as its input an ASCII file containing a series of articles to be tagged. These articles are of closely defined format, although some fields may be left blank. The tagger parses each article searching for the pattern {<title>} which indicates a reference to another article. For each match, the tagger replaces {<title>} with {<title>,<key>} where the field {<key>} is a previously existing or new unique key for the article referred to. In the case that some articles on different subjects have the same title, the unique keys are distinguished interactively with the aid of a description field which is recorded with the unique keys.

The tagger maintains its own database of article titles vs. unique keys so that it is aware of articles that have been tagged but not yet imported into the Hyper-Text Database. This is especially important when many articles in a long file are being tagged at once.

The current article is itself assigned a unique key which is stored as a field in the tagged article for the use of the IMPORTER program.

The tagger will produce a file containing a series of well formatted and correctly tagged articles. Such a file is the only valid input to the IMPORTER program.

Should errors occur during the tagging process, changes resulting from the offensive article will not be saved, but all other changes will be. The tagger is required to recover from errors when possible, to process the remaining articles.

In order to isolate the changes made due to a current article, a transaction mechanism is used. The database is opened at the start of execution and closed at the end and at the start of each article a new transaction is initiated. If the article is tagged with no problems then the transaction ends normally, saving all changes to the database. If any errors occur that can not be recovered from, the transaction aborts, leaving the database unchanged.

This is demonstrated in the following algorithm

Open file
Open database
While (there is another article)
        Start a transaction
                make key for this article
                tag references with appropriate unique keys
        End transaction              /* commits to database */
        Except => abort transaction  /* leaves database unchanged */
Close all

When a reference that needs tagging is found, the title of that reference is looked up in the key-tagger database. If no entry is found, then a new unique key must be created. If any entries are found, then a decision is made interactively whether to use one of these or to create a new one.

When new entries in the database are created, a description field is provided to record information about the subject of the associated subject and the creation of the entry. When an article is first imported or is at a later stage edited, this field can be changed.



next up previous
Next: Importer Up: Design of Modules Previous: Design of Modules

This page is maintained by The Syriac Computing Institute
Last updated: May 6, 1996