Source Code Tour


The bin/ directory contains shell scripts to perform most upkeep tasks in AtD.  The most important file here is bin/ which rebuilds all the AtD models.


The data directory has the data files used to train the AI and build the rule model.


Download the bootstrap data and place your extra writing samples into this folder. Plain text and HTML formatted text are both acceptable.


This folder contains the rules used by the AtD grammar and style checker.


This directory contains formatted text files used to train the AtD spell checker and misused word models.


The lib/ directory contains most of the stuff used by AtD during runtime.


This has functions to load the spell checker dictionary and construct the Trie used to generate suggestions.  The Trie construction happens in Sleep.  Walking the Trie and generating suggestions happens in Java.  The edits2 function exists in this file as an easier to read reference on how the Trie walking algorithm works.


This file contains the checkDocument function that is called when a document is checked.  The heart of iterating through a document and applying the rule engine and spell checker to it are contained here.


This file contains the abstract rule engine for AtD.  All rules are compiled into a tree structure and the deepest match is what is returned when running a sentence through it.


Generic neural network code used by AtD.  The comments in the file show how to use the API.


This file contains the sentence and word segmentation code used by AtD.


This file contains a simple object system that some parts of AtD use.  This technique is covered in Chapter 5.3 of the Sleep 2.1 Manual.  If you see a function declared as sub someClass::functionName { } then you’ve encountered this system.  The neural network and some of the code in utils/ uses this technique.


This file contains utility functions for generating quality statistics about a document.


The heart of the spell checker and misused word detector are in this file.


This file contains functions to tag a sentence with its parts-of-speech.


This file contains tools to stem words and convert between different tenses and counts.


The models directory is where AtD dumps the models and data it uses during runtime.  The .bin objects are serialized Java objects.


The service/ folder contains the view portion of the AtD service.  These files are used by Moconti (the Sleep Application Server) to implement the AtD API.


After the Deadline is written in a combination of Sleep and Java.  Sleep is a Perl-like language that runs on top of Java.  Some methods were ported to Java for performance reasons.  The Java source code is located in service/code. To rebuild the Java code you’ll need Apache Ant and a symbolic link to the lib/ directory from service/code/lib.


This folder is the root directory for serving files used by Moconti.  If you want your AtD service instance to serve web files, dump them here.  Otherwise you can ignore this folder.


This file should contain your local modifications to AtD. It is loaded by and the function service_init is called after everything else in has loaded. Here you can redefine parts of the AtD protocol and add your own functions. We will not touch this file in subversion.


The src/ folder contains the loaded by the Moconti Application Server.  I recommend reading the docs included with Moconti to understand this setup.  The service/src/ implements the After the Deadline API.  To start understanding how AtD works and tracing functions, you’ll want to start with this file.


This folder contains templates for the AtD XML API.  These files are reference in service/src/ and the info.slp call to get more information on an error.


This folder is the ugliest part of AtD.  Fortunately it has little to do with the runtime operation of AtD.  Most of the code here is used to train and test models.  A lot of code here is left over from various experiments I tried when building AtD.  Navigate it at your own peril.


This is the code used to construct the bigram and trigram language model used by AtD.


A lot of these files are common to the training and testing parts of the spell checker and misused word detection.  The organization here is poor.


This file is important to the rule engine as it is where all the AtD grammar / style rules are loaded and constructed into the models/rules.bin file.


Code to train and test the spell checker and misused word detector.


Code to generate data files used by AtD to train and test various features.


Code to train and test the part-of-speech tagger

%d bloggers like this: