@Override
    public void endElement(String namespaceURI, String localName, String qName) throws SAXException {
        switch(currentTag){
            case TITLE:
                word = data.toString();
                word = Utils.replaceUnicodeQuotation( word );
                if(!generator.isValidWord(word)){
                    word = null;
                }
                break;
            case TEXT:
                text = data.toString();
                break;
            default:
                if("page".equals(localName)){
                    if(word != null){
                        try{
                            generator.getBook().incTitleCount();
                            text = Utils.replaceUnicodeQuotation( text );
                            if(generator.isValidLanguage(word, text)){
                                generator.getBook().incLanguageTitleCount();
                                generator.addWord(word);
                            }
                        }catch(Throwable th){
                            th.printStackTrace();
                        }
                    }
                }
        }
        currentTag = NONE;
    }