public void addPage(String document){
        //add to termIndex the parsed words from *document*
        HTMLParser pageParser = new HTMLParser(document);

        docCount++;

        //For each word in our parsed array...
        for(String word: pageParser.getParsedArray()){

            if (termIndex.size() == 0) {
                addNewTerm(word, document);
            }

            else{
                boolean add = false;
                boolean cont = true;
                for(Term term: termIndex){
                    if(cont) {
                        add = true;
                        if (word.equals(term.getName())) {
                            term.addNewOccurrence(document);
                            cont = false;
                            add = false;
                        }
                    }
                }
                if(add) {
                    addNewTerm(word, document);
                }
            }
        }
    }