import java.io.*;

/**
 * A caommand-line application that creates a line-number index
 * of a text.
 *
 * @author  Prof. David Bernstein, James Madison University
 * @version 1.0
 */
public class Lindex
{
    /**
     * The entry point of the application.
     *
     * @param args  The command line arguments (which are ignored)
     */
    public static void main(String[] args) throws IOException
    {
        String name;
        BufferedReader in = new BufferedReader(
            new InputStreamReader(System.in));

        System.out.print("Title: ");        
        while ((name = in.readLine()) != null)
        {
            Indexer indexer = new Indexer(name, 4);

            // Since this method can take a significant amount of time,
            // the UI may not be responsive.
            indexer.createIndex();

            System.out.print("Title: ");        
        }
    }
}
