static Parser parse(Reader reader) {
        Scanner inp = new Scanner(reader);
        Parser result = new Parser();
        ArrayList<String> sentences = new ArrayList<String>();
        while (inp.hasNextLine()) {
            String line = inp.nextLine();
            if (line.trim().length() == 0) {
                continue;
            }
            String[] words = line.trim().split("\\s+");
            String sentence = "";
            char lastChar = '0';
            for (int i = 0; i < words.length; i += 1) {
                lastChar = words[i].charAt(words[i].length() - 1);
                if (lastChar == '.' || lastChar == '?') {
                    if (words[i].length() > 1) {
                        sentence += words[i];
                        sentences.add(sentence);
                        sentence = "";
                    } else {
                        sentence = sentence.trim();
                        sentence += words[i];
                        sentences.add(sentence);
                    }
                } else {
                    sentence += words[i];
                    sentence += " ";
                }
            }
            if (!(lastChar == '.' || lastChar == '?')) {
                inp.close();
                throw new PuzzleException(
                        "a line contained an incomplete sentence");
            }
        }
        inp.close();
        distributeSentences(result, sentences);
        checkGrammar(result);
        result.assertions = loadEntities(result.assertions);
        result.questions = loadEntities(result.questions);
        result.people = people(result.assertions);
        result.jobs = jobs(result.assertions);
        result.colors = colors(result.assertions);
        checkDiction(result);
        return result;
    }