public void addDocument(File f) throws IOException
    {
        String document = "";
        BufferedReader io = new BufferedReader(new FileReader(f));
        String line;
        boolean markUpFile = false, captureText = false;
        while((line = io.readLine()) != null)
        {
            if(line.startsWith("<DOC>")) markUpFile = true;
            else if(!markUpFile) captureText = true;
            if(markUpFile && line.startsWith("<TEXT>"))
            {
                captureText = true;
                continue;
            }
            if(markUpFile && line.startsWith("</TEXT>")) captureText = false;
            if(!captureText) continue;
            
            document += line + " ";
            
            if(line.equals("\n"))
            {
                stemDocument(document);
                document = "";
            }
        }
        stemDocument(document);
    }