/*
 * SDK Pullenti Lingvo, version 4.33, fabruary 2026. Copyright (c) 2013-2026, Pullenti. All rights reserved. 
 * Non-Commercial Freeware and Commercial Software.
 * This class is generated using the converter Unisharping (www.unisharping.ru) from Pullenti C# project. 
 * The latest version of the code is available on the site www.pullenti.ru
 */

package com.pullenti.ner.resume;

/**
 * Анализатор резюме (специфический анализатор)
 */
public class ResumeAnalyzer extends com.pullenti.ner.Analyzer {

    /**
     * Имя анализатора ("RESUME")
     */
    public static final String ANALYZER_NAME = "RESUME";

    @Override
    public String getName() {
        return ANALYZER_NAME;
    }


    @Override
    public String getCaption() {
        return "Резюме";
    }


    @Override
    public String getDescription() {
        return "Текст содержит одно резюме";
    }


    @Override
    public com.pullenti.ner.Analyzer clone() {
        return new ResumeAnalyzer();
    }

    @Override
    public boolean isSpecific() {
        return true;
    }


    @Override
    public java.util.Collection<com.pullenti.ner.metadata.ReferentClass> getTypeSystem() {
        return java.util.Arrays.asList(new com.pullenti.ner.metadata.ReferentClass[] {MetaResume.GLOBALMETA});
    }


    @Override
    public java.util.HashMap<String, byte[]> getImages() {
        java.util.HashMap<String, byte[]> res = new java.util.HashMap<String, byte[]>();
        res.put(MetaResume.IMAGEID.toString(), com.pullenti.ner.core.internal.ResourceHelper3.getBytes("resume.png"));
        return res;
    }


    @Override
    public com.pullenti.ner.Referent createReferent(String type) {
        if (com.pullenti.unisharp.Utils.stringsEq(type, ResumeItemReferent.OBJ_TYPENAME)) 
            return new ResumeItemReferent();
        return null;
    }

    @Override
    public int getProgressWeight() {
        return 1;
    }


    @Override
    public void process(com.pullenti.ner.core.AnalysisKit kit) {
        com.pullenti.ner.core.AnalyzerData ad = kit.getAnalyzerData(this);
        boolean hasSex = false;
        boolean hasMoney = false;
        boolean hasPos = false;
        boolean hasSpec = false;
        boolean hasSkills = false;
        boolean hasExp = false;
        boolean hasEdu = false;
        boolean hasAbout = false;
        com.pullenti.ner.ReferentToken rt;
        com.pullenti.ner.person.PersonReferent pers0 = null;
        int cou = 0;
        for (com.pullenti.ner.Token t = kit.firstToken; t != null; t = t.getNext()) {
            com.pullenti.ner.Token tt = com.pullenti.ner.core.MiscHelper.checkImage(t);
            if (tt != null) {
                t = tt;
                continue;
            }
            com.pullenti.ner.person.PersonReferent pers = (com.pullenti.ner.person.PersonReferent)com.pullenti.unisharp.Utils.cast(t.getReferent(), com.pullenti.ner.person.PersonReferent.class);
            if (pers != null) {
                if (!t.isNewlineBefore() && cou > 10) 
                    break;
                if (cou > 10 && ((com.pullenti.ner.ReferentToken)com.pullenti.unisharp.Utils.cast(t, com.pullenti.ner.ReferentToken.class)).getBeginToken().isValue("ИП", null)) 
                    break;
                rt = new com.pullenti.ner.ReferentToken(ad.registerReferent(ResumeItemReferent._new3517(ResumeItemType.PERSON, pers)), t, t, null);
                kit.embedToken(rt);
                pers0 = pers;
                break;
            }
            if (t.getLengthChar() > 1) 
                cou++;
        }
        boolean opyt = false;
        boolean hasEduOrg = false;
        ResumeItemType curTyp = ResumeItemType.UNDEFINED;
        for (com.pullenti.ner.Token t = kit.firstToken; t != null; t = (t == null ? null : t.getNext())) {
            if (pers0 != null) {
                if ((t.getReferent() instanceof com.pullenti.ner.uri.UriReferent) || (t.getReferent() instanceof com.pullenti.ner.phone.PhoneReferent) || (t.getReferent() instanceof com.pullenti.ner.address.AddressReferent)) {
                    com.pullenti.ner.uri.UriReferent uri = (com.pullenti.ner.uri.UriReferent)com.pullenti.unisharp.Utils.cast(t.getReferent(), com.pullenti.ner.uri.UriReferent.class);
                    if (uri != null) {
                        if (com.pullenti.unisharp.Utils.stringsNe(uri.getScheme(), "mailto") && com.pullenti.unisharp.Utils.stringsNe(uri.getScheme(), "telegram")) 
                            continue;
                        if ((uri.getValue().indexOf("rating@mail.ru") >= 0)) 
                            continue;
                    }
                    rt = new com.pullenti.ner.ReferentToken(ad.registerReferent(ResumeItemReferent._new3517(ResumeItemType.CONTACT, t.getReferent())), t, t, null);
                    kit.embedToken(rt);
                    continue;
                }
            }
            if (pers0 != null && !opyt) {
                if ((t.getReferent() instanceof com.pullenti.ner.geo.GeoReferent) || (t.getReferent() instanceof com.pullenti.ner.address.StreetReferent)) {
                    com.pullenti.ner.geo.GeoReferent _geo = (com.pullenti.ner.geo.GeoReferent)com.pullenti.unisharp.Utils.cast(t.getReferent(), com.pullenti.ner.geo.GeoReferent.class);
                    if (_geo != null && !_geo.isCity()) 
                        continue;
                    rt = new com.pullenti.ner.ReferentToken(ad.registerReferent(ResumeItemReferent._new3517(ResumeItemType.CONTACT, t.getReferent())), t, t, null);
                    kit.embedToken(rt);
                    continue;
                }
            }
            if (t.isValue("КОНТАКТЫ", null)) {
            }
            if (t.isValue2("ДАТА", "РОЖДЕНИЯ") || t.isValue("РОДИТЬСЯ", null)) {
                for (com.pullenti.ner.Token tt = t.getNext(); tt != null; tt = tt.getNext()) {
                    com.pullenti.ner.Referent r = tt.getReferent();
                    if (r instanceof com.pullenti.ner.date.DateReferent) {
                        if (pers0 != null) 
                            pers0.addSlot(com.pullenti.ner.person.PersonReferent.ATTR_BORN, r, false, 0);
                        else {
                        }
                        break;
                    }
                    if (tt.isValue("РОЖДЕНИЕ", null)) 
                        continue;
                    if (tt.getReferent() instanceof com.pullenti.ner.geo.GeoReferent) 
                        continue;
                    if (tt.getLengthChar() > 1) 
                        break;
                }
                continue;
            }
            if (t.getReferent() instanceof com.pullenti.ner.person.PersonIdentityReferent) {
                rt = new com.pullenti.ner.ReferentToken(ad.registerReferent(ResumeItemReferent._new3517(ResumeItemType.DOCUMENT, t.getReferent())), t, t, null);
                kit.embedToken(rt);
                t = rt;
                continue;
            }
            if (!t.isNewlineBefore()) 
                continue;
            if (t.isTableControlChar() && t.getNext() != null) 
                t = t.getNext();
            if (t.isValue("ОБРАЗОВАНИЕ", null)) 
                curTyp = ResumeItemType.STUDY;
            if (t.isValue2("ОПЫТ", "РАБОТЫ") || t.isValue2("МЕСТО", "РАБОТЫ") || t.isValue2("ПЕРИОД", "РАБОТЫ")) {
                opyt = true;
                curTyp = ResumeItemType.ORGANIZATION;
            }
            rt = _parseOrg(t, curTyp);
            if (rt != null) {
                rt.referent = ad.registerReferent(rt.referent);
                rt.referent.tag = rt;
                kit.embedToken(rt);
                curTyp = ((ResumeItemReferent)com.pullenti.unisharp.Utils.cast(rt.referent, ResumeItemReferent.class)).getTyp();
                if (curTyp == ResumeItemType.STUDY) 
                    hasEduOrg = true;
                t = rt;
                continue;
            }
            rt = _parseOrg2(t, ad, null);
            if (rt != null) {
                t = rt;
                curTyp = ResumeItemType.ORGANIZATION;
                continue;
            }
            if (!hasSex) {
                rt = _parseSex(t, ad);
                if (rt != null) {
                    hasSex = true;
                    t = rt;
                    continue;
                }
            }
            if (_checkGeo(t)) 
                continue;
            if (!hasMoney && (t.getReferent() instanceof com.pullenti.ner.money.MoneyReferent)) {
                ResumeItemReferent _money = new ResumeItemReferent();
                hasMoney = true;
                _money.setTyp(ResumeItemType.MONEY);
                _money.setRef(t.getReferent());
                rt = new com.pullenti.ner.ReferentToken(ad.registerReferent(_money), t, t, null);
                kit.embedToken(rt);
                t = rt;
                continue;
            }
            if (!hasExp) {
                rt = _parseExperience(t, ad);
                if (rt != null) {
                    hasExp = true;
                    t = rt;
                    continue;
                }
            }
            if (!hasSpec && t.isValue("СПЕЦИАЛИЗАЦИЯ", null)) {
                if (t.getNext() != null && t.getNext().isChar(':')) 
                    t = t.getNext();
                rt = _parseList(t.getNext(), ad, ResumeItemType.SPECIALITY);
                if (rt != null) {
                    hasSpec = true;
                    t = rt;
                    continue;
                }
            }
            com.pullenti.ner.core.NounPhraseToken npt = com.pullenti.ner.core.NounPhraseHelper.tryParse(t, com.pullenti.ner.core.NounPhraseParseAttr.NO, 0, null);
            if (npt != null && ((npt.getEndToken().isValue("НАВЫК", null) || npt.getEndToken().isValue("КОМПЕТЕНЦИЯ", null)))) {
                com.pullenti.ner.Token tt = npt.getEndToken().getNext();
                if (tt != null && tt.isValue2("И", "ДОСТИЖЕНИЕ")) 
                    tt = tt.getNext().getNext();
                rt = _parseList(tt, ad, ResumeItemType.SKILL);
                if (rt != null) {
                    hasSkills = true;
                    t = rt;
                    continue;
                }
            }
            if (!hasAbout && (((t.isValue2("О", "МНЕ") || t.isValue2("О", "СЕБЕ") || t.isValue2("ЛИЧНЫЕ", "КАЧЕСТВА")) || t.isValue2("ДОПОЛНИТЕЛЬНЫЕ", "СВЕДЕНИЯ")))) {
                rt = _parseAboutMe(t.getNext().getNext(), ad);
                if (rt != null) {
                    hasAbout = true;
                    t = rt;
                    continue;
                }
            }
            if (!hasSpec && hasSex && !hasPos) {
                rt = _parseList(t, ad, ResumeItemType.POSITION);
                if (rt != null) {
                    hasPos = true;
                    t = rt;
                    continue;
                }
            }
            if (!hasEdu) {
                com.pullenti.ner.MetaToken mt = _parseEducation(t);
                if (mt != null) {
                    curTyp = ResumeItemType.STUDY;
                    ResumeItemReferent edu = new ResumeItemReferent();
                    hasEdu = true;
                    edu.setTyp(ResumeItemType.EDUCATION);
                    edu.setValue((String)com.pullenti.unisharp.Utils.cast(mt.tag, String.class));
                    rt = new com.pullenti.ner.ReferentToken(ad.registerReferent(edu), mt.getBeginToken(), mt.getEndToken(), null);
                    kit.embedToken(rt);
                    t = rt;
                    continue;
                }
            }
            rt = _parseDriving(t, ad);
            if (rt != null) {
                t = rt;
                continue;
            }
        }
        if (!hasEduOrg) {
            for (com.pullenti.ner.Token t = kit.firstToken; t != null; t = t.getNext()) {
                com.pullenti.ner._org.OrganizationReferent __org = (com.pullenti.ner._org.OrganizationReferent)com.pullenti.unisharp.Utils.cast(t.getReferent(), com.pullenti.ner._org.OrganizationReferent.class);
                if (__org == null) 
                    continue;
                if (__org.getProfiles().contains(com.pullenti.ner._org.OrgProfile.EDUCATION) && !(__org.tag instanceof ResumeItemReferent)) {
                    com.pullenti.ner.Referent it = ad.registerReferent(ResumeItemReferent._new3517(ResumeItemType.STUDY, __org));
                    rt = new com.pullenti.ner.ReferentToken(it, t, t, null);
                    kit.embedToken(rt);
                    break;
                }
            }
        }
    }

    private static com.pullenti.ner.ReferentToken _parseSex(com.pullenti.ner.Token t, com.pullenti.ner.core.AnalyzerData ad) {
        if (t.isValue2("ПОЛНЫХ", "ЛЕТ")) {
            t = t.getNext().getNext();
            if (t != null && t.isCharOf(":-")) 
                t = t.getNext();
            if (t instanceof com.pullenti.ner.NumberToken) {
                ResumeItemReferent age = new ResumeItemReferent();
                age.setTyp(ResumeItemType.AGE);
                age.setValue(((com.pullenti.ner.NumberToken)com.pullenti.unisharp.Utils.cast(t, com.pullenti.ner.NumberToken.class)).getValue());
                com.pullenti.ner.ReferentToken rt0 = new com.pullenti.ner.ReferentToken(ad.registerReferent(age), t, t, null);
                t.kit.embedToken(rt0);
                return rt0;
            }
        }
        if (!t.isValue("МУЖЧИНА", null) && !t.isValue("ЖЕНЩИНА", null)) 
            return null;
        ResumeItemReferent sex = new ResumeItemReferent();
        sex.setTyp(ResumeItemType.SEX);
        sex.setValue((t.isValue("МУЖЧИНА", null) ? "муж" : "жен"));
        com.pullenti.ner.ReferentToken rt = new com.pullenti.ner.ReferentToken(ad.registerReferent(sex), t, t, null);
        t.kit.embedToken(rt);
        t = rt;
        for (com.pullenti.ner.Token tt = t.getNext(); tt != null; tt = tt.getNext()) {
            if (tt.isNewlineBefore()) 
                break;
            if ((tt instanceof com.pullenti.ner.NumberToken) && tt.getNext() != null) {
                if (tt.getNext().isValue("ГОД", null) || tt.getNext().isValue("ЛЕТ", null)) {
                    ResumeItemReferent age = new ResumeItemReferent();
                    age.setTyp(ResumeItemType.AGE);
                    age.setValue(((com.pullenti.ner.NumberToken)com.pullenti.unisharp.Utils.cast(tt, com.pullenti.ner.NumberToken.class)).getValue());
                    rt = new com.pullenti.ner.ReferentToken(ad.registerReferent(age), tt, tt.getNext(), null);
                    t.kit.embedToken(rt);
                    t = rt;
                    break;
                }
            }
        }
        return rt;
    }

    private static com.pullenti.ner.ReferentToken _parseExperience(com.pullenti.ner.Token t, com.pullenti.ner.core.AnalyzerData ad) {
        if (!t.isValue2("ОПЫТ", "РАБОТЫ")) 
            return null;
        for (com.pullenti.ner.Token tt = t.getNext(); tt != null; tt = tt.getNext()) {
            if (tt.isNewlineBefore() && !tt.getPrevious().isCharOf(":-")) 
                break;
            if ((tt instanceof com.pullenti.ner.NumberToken) && tt.getNext() != null) {
                if (tt.getNext().isValue("ГОД", null) || tt.getNext().isValue("ЛЕТ", null) || tt.getNext().isValue("МЕСЯЦ", null)) {
                    ResumeItemReferent experience = new ResumeItemReferent();
                    experience.setTyp(ResumeItemType.EXPERIENCE);
                    experience.setValue(((com.pullenti.ner.NumberToken)com.pullenti.unisharp.Utils.cast(tt, com.pullenti.ner.NumberToken.class)).getValue());
                    if (tt.getNext().isValue("МЕСЯЦ", null)) 
                        experience.setValue(com.pullenti.ner.core.NumberHelper.doubleToString(com.pullenti.unisharp.Utils.mathRound(((com.pullenti.ner.NumberToken)com.pullenti.unisharp.Utils.cast(tt, com.pullenti.ner.NumberToken.class)).getRealValue() / (12.0), 1)));
                    com.pullenti.ner.Token tt1 = tt.getNext();
                    if ((tt1.getNext() instanceof com.pullenti.ner.NumberToken) && tt1.getNext().getNext() != null && tt1.getNext().getNext().isValue("МЕСЯЦ", null)) {
                        double d = com.pullenti.unisharp.Utils.mathRound(((com.pullenti.ner.NumberToken)com.pullenti.unisharp.Utils.cast(tt, com.pullenti.ner.NumberToken.class)).getRealValue() + ((((com.pullenti.ner.NumberToken)com.pullenti.unisharp.Utils.cast(tt1.getNext(), com.pullenti.ner.NumberToken.class)).getRealValue() / (12.0))), 1);
                        experience.setValue(com.pullenti.ner.core.NumberHelper.doubleToString(d));
                        tt1 = tt1.getNext().getNext();
                    }
                    com.pullenti.ner.ReferentToken rt = new com.pullenti.ner.ReferentToken(ad.registerReferent(experience), tt, tt1, null);
                    t.kit.embedToken(rt);
                    return rt;
                }
            }
        }
        return null;
    }

    private static com.pullenti.ner.MetaToken _parseEducation(com.pullenti.ner.Token t) {
        boolean hi = false;
        boolean middl = false;
        boolean prof = false;
        boolean spec = false;
        boolean tech = false;
        boolean neok = false;
        boolean _keyword = false;
        com.pullenti.ner.Token t0 = t;
        com.pullenti.ner.Token t1 = t;
        for (; t != null; t = t.getNext()) {
            if (t0 != t && t.isNewlineBefore()) {
                if (t.getPrevious() != null && t.getPrevious().isCharOf(":-")) {
                }
                else 
                    break;
            }
            if (t.isValue("СРЕДНИЙ", null) || t.isValue("СРЕДНЕ", null) || t.isValue("СРЕДН", null)) 
                middl = true;
            else if (t.isValue("ВЫСШИЙ", null) || t.isValue("ВЫСШ", null)) 
                hi = true;
            else if (t.isValue("НЕОКОНЧЕННЫЙ", null)) 
                neok = true;
            else if (t.isValue("ПРОФЕССИОНАЛЬНЫЙ", null) || t.isValue("ПРОФ", null) || t.isValue("ПРОФИЛЬНЫЙ", null)) 
                prof = true;
            else if ((t.isValue("СПЕЦИАЛЬНЫЙ", null) || t.isValue("СПЕЦ", null) || t.isValue2("ПО", "СПЕЦИАЛЬНОСТЬ")) || t.isValue2("ПО", "НАПРАВЛЕНИЕ")) 
                spec = true;
            else if ((t.isValue("ТЕХНИЧЕСКИЙ", null) || t.isValue("ТЕХ", null) || t.isValue("ТЕХН", null)) || t.isValue("ТЕХНИЧ", null)) 
                tech = true;
            else if (t.isValue("ОБРАЗОВАНИЕ", null)) {
                _keyword = true;
                t1 = t;
            }
            else if (t.getLengthChar() > 1) 
                break;
        }
        if (!_keyword) 
            return null;
        if (!hi && !middl) {
            if ((spec || prof || tech) || neok) 
                middl = true;
            else 
                return null;
        }
        String val = (hi ? "ВО" : "СО");
        if (spec) 
            val += ",спец";
        if (prof) 
            val += ",проф";
        if (tech) 
            val += ",тех";
        if (neok) 
            val += ",неоконч";
        return com.pullenti.ner.MetaToken._new663(t0, t1, val);
    }

    private static com.pullenti.ner.MetaToken _parseMoral(com.pullenti.ner.Token t) {
        com.pullenti.ner.core.TerminToken tok = com.pullenti.ner.vacance.internal.VacanceToken.M_TERMINS.tryParse(t, com.pullenti.ner.core.TerminParseAttr.NO);
        if (tok == null || tok.termin.tag2 != null) 
            return null;
        com.pullenti.ner.vacance.internal.VacanceTokenType ty = (com.pullenti.ner.vacance.internal.VacanceTokenType)tok.termin.tag;
        if (ty != com.pullenti.ner.vacance.internal.VacanceTokenType.MORAL) 
            return null;
        String val = (String.valueOf(tok.termin.getCanonicText().charAt(0)) + tok.termin.getCanonicText().substring(1).toLowerCase());
        com.pullenti.ner.Token t1 = tok.getEndToken();
        for (com.pullenti.ner.Token tt = tok.getEndToken().getNext(); tt != null; tt = tt.getNext()) {
            if (tt.getWhitespacesBeforeCount() > 2) 
                break;
            if (com.pullenti.ner.vacance.internal.VacanceToken.M_TERMINS.tryParse(tt, com.pullenti.ner.core.TerminParseAttr.NO) != null) 
                break;
            com.pullenti.ner.core.NounPhraseToken npt = com.pullenti.ner.core.NounPhraseHelper.tryParse(tt, com.pullenti.ner.core.NounPhraseParseAttr.of((com.pullenti.ner.core.NounPhraseParseAttr.PARSEPREPOSITION.value()) | (com.pullenti.ner.core.NounPhraseParseAttr.PARSEPRONOUNS.value())), 0, null);
            if (npt == null) 
                break;
            tt = (t1 = npt.getEndToken());
        }
        if (t1.getEndChar() > tok.getEndChar()) 
            val = (val + " " + com.pullenti.ner.core.MiscHelper.getTextValue(tok.getEndToken().getNext(), t1, com.pullenti.ner.core.GetTextAttr.of((com.pullenti.ner.core.GetTextAttr.KEEPQUOTES.value()) | (com.pullenti.ner.core.GetTextAttr.KEEPREGISTER.value()))));
        return com.pullenti.ner.MetaToken._new663(t, t1, val);
    }

    private static com.pullenti.ner.ReferentToken _parseDriving(com.pullenti.ner.Token t, com.pullenti.ner.core.AnalyzerData ad) {
        if (t == null) 
            return null;
        com.pullenti.ner.Token t1 = null;
        if (t.isValue("НАЛИЧИЕ", null) && t.getNext() != null) 
            t = t.getNext();
        if ((t.isValue2("ВОДИТЕЛЬСКИЕ", "ПРАВА") || t.isValue2("ПРАВА", "КАТЕГОРИИ") || t.isValue2("ВОДИТЕЛЬСКОЕ", "УДОСТОВЕРЕНИЕ")) || t.isValue2("УДОСТОВЕРЕНИЕ", "ВОДИТЕЛЯ") || t.isValue2("ПРАВА", "ВОДИТЕЛЯ")) 
            t1 = t.getNext().getNext();
        if (t1 == null) 
            return null;
        com.pullenti.ner.Token t0 = t;
        String val = null;
        for (t = t1; t != null; t = t.getNext()) {
            if ((t.isHiphen() || t.isTableControlChar() || t.isCharOf(":.")) || t.isValue("КАТЕГОРИЯ", null) || t.isValue("КАТ", null)) 
                continue;
            if ((t instanceof com.pullenti.ner.TextToken) && t.getLengthChar() <= 3 && t.chars.isLetter()) {
                val = ((com.pullenti.ner.TextToken)com.pullenti.unisharp.Utils.cast(t, com.pullenti.ner.TextToken.class)).term;
                t1 = t;
                for (t = t.getNext(); t != null; t = t.getNext()) {
                    if (t.getWhitespacesBeforeCount() > 2) 
                        break;
                    else if (t.isChar('.') || t.isCommaAnd()) 
                        continue;
                    else if (t.getLengthChar() == 1 && t.chars.isAllUpper() && t.chars.isLetter()) {
                        val = (val + ((com.pullenti.ner.TextToken)com.pullenti.unisharp.Utils.cast(t, com.pullenti.ner.TextToken.class)).term);
                        t1 = t;
                    }
                    else 
                        break;
                }
                val = val.replace("А", "A").replace("В", "B").replace("С", "C");
                break;
            }
            break;
        }
        if (val == null) 
            return null;
        ResumeItemReferent drv = new ResumeItemReferent();
        drv.setTyp(ResumeItemType.DRIVINGLICENSE);
        drv.setValue(val);
        com.pullenti.ner.ReferentToken rt = new com.pullenti.ner.ReferentToken(ad.registerReferent(drv), t0, t1, null);
        t0.kit.embedToken(rt);
        return rt;
    }

    private static com.pullenti.ner.MetaToken _parseOnto(com.pullenti.ner.Token t) {
        if (t == null) 
            return null;
        if (t.kit.ontology == null) 
            return null;
        java.util.ArrayList<com.pullenti.ner.core.IntOntologyToken> lii = t.kit.ontology.attachToken(ANALYZER_NAME, t);
        if (lii == null || lii.size() == 0) 
            return null;
        if (!(lii.get(0).item.referent instanceof ResumeItemReferent)) 
            return null;
        String val = ((ResumeItemReferent)com.pullenti.unisharp.Utils.cast(lii.get(0).item.referent, ResumeItemReferent.class)).getValue();
        val = (String.valueOf(val.charAt(0)) + val.substring(1).toLowerCase());
        return com.pullenti.ner.MetaToken._new663(t, lii.get(0).getEndToken(), val);
    }

    public static boolean _startOfItem(com.pullenti.ner.Token t) {
        if (t == null) 
            return false;
        if (t.isTableControlChar() && t.getNext() != null) 
            t = t.getNext();
        if (t.isNewlineBefore()) {
        }
        else if (t.getPrevious() != null && t.getPrevious().isTableControlChar() && t.getPrevious().isNewlineBefore()) {
        }
        else 
            return false;
        if (t.isValue2("О", "МНЕ") || t.isValue2("О", "СЕБЕ") || t.isValue2("ДОПОЛНИТЕЛЬНЫЕ", "СВЕДЕНИЯ")) 
            return true;
        if (t.isValue("ИНТЕРЕСНЫ", null)) 
            return true;
        com.pullenti.ner.core.NounPhraseToken npt = com.pullenti.ner.core.NounPhraseHelper.tryParse(t, com.pullenti.ner.core.NounPhraseParseAttr.NO, 0, null);
        if (npt != null) {
            com.pullenti.ner.Token tt = npt.getEndToken();
            if ((((tt.isValue("КОНТАКТ", null) || tt.isValue("ТЕЛЕФОН", null) || tt.isValue("РЕЗЮМЕ", null)) || tt.isValue("ГРАФИК", null) || tt.isValue("ЗАНЯТОСТЬ", null)) || tt.isValue("ОПЫТ", null) || tt.isValue("ОБРАЗОВАНИЕ", null)) || tt.isValue("ИНФОРМАЦИЯ", null)) 
                return true;
            if (tt.isValue("НАВЫК", null)) {
                if (t.isValue("КЛЮЧЕВОЙ", null) || t.isValue("ПРОФЕССИОНАЛЬНЫЙ", null)) 
                    return true;
            }
            if (tt.isValue("КОМПЕТЕНЦИЯ", null)) 
                return true;
        }
        return false;
    }

    private static com.pullenti.ner.ReferentToken _parseList(com.pullenti.ner.Token t, com.pullenti.ner.core.AnalyzerData ad, ResumeItemType typ) {
        com.pullenti.ner.ReferentToken rt = null;
        ResumeItemReferent spec;
        for (; t != null; t = t.getNext()) {
            if (!t.isChar(':') && !t.isTableControlChar()) 
                break;
        }
        if (t == null) 
            return null;
        com.pullenti.ner.Token t0 = t;
        for (; t != null; t = t.getNext()) {
            if (t.isNewlineBefore()) {
                if (t.getNewlinesBeforeCount() > 1 && t != t0) 
                    break;
                if (_startOfItem(t)) 
                    break;
                if (t == t0 && typ == ResumeItemType.POSITION) {
                }
                else if (typ == ResumeItemType.SKILL || typ == ResumeItemType.SPECIALITY) {
                }
                else 
                    break;
            }
            if (t.isCharOf(";,")) 
                continue;
            if (com.pullenti.ner.core.BracketHelper.canBeStartOfSequence(t, true, false)) {
                com.pullenti.ner.core.BracketSequenceToken br = com.pullenti.ner.core.BracketHelper.tryParse(t, com.pullenti.ner.core.BracketParseAttr.NO, 100);
                if (br != null) {
                    spec = new ResumeItemReferent();
                    spec.setTyp(typ);
                    spec.setValue(_corrValue(com.pullenti.ner.core.MiscHelper.getTextValue(t.getNext(), br.getEndToken().getPrevious(), com.pullenti.ner.core.GetTextAttr.of((com.pullenti.ner.core.GetTextAttr.KEEPQUOTES.value()) | (com.pullenti.ner.core.GetTextAttr.KEEPREGISTER.value())))));
                    rt = new com.pullenti.ner.ReferentToken(ad.registerReferent(spec), t, br.getEndToken(), null);
                    t.kit.embedToken(rt);
                    t = rt;
                    continue;
                }
            }
            if (typ == ResumeItemType.SKILL) {
                com.pullenti.ner.core.TerminToken tok = com.pullenti.ner.vacance.internal.VacanceToken.M_SKILLITEMS.tryParse(t, com.pullenti.ner.core.TerminParseAttr.NO);
                if (tok != null) {
                    spec = new ResumeItemReferent();
                    spec.setTyp(typ);
                    spec.setValue(tok.termin.getCanonicText());
                    rt = new com.pullenti.ner.ReferentToken(ad.registerReferent(spec), t, tok.getEndToken(), null);
                    t.kit.embedToken(rt);
                    t = rt;
                    continue;
                }
            }
            com.pullenti.ner.Token t1 = t;
            for (com.pullenti.ner.Token tt = t.getNext(); tt != null; tt = tt.getNext()) {
                if (tt.isNewlineBefore()) {
                    if (tt.getPrevious().isHiphen()) 
                        continue;
                    break;
                }
                if (tt.isCharOf(";,") || com.pullenti.ner.core.MiscHelper.canBeStartOfSentence(tt)) 
                    break;
                if (tt.isChar('(')) {
                    com.pullenti.ner.core.BracketSequenceToken br = com.pullenti.ner.core.BracketHelper.tryParse(tt, com.pullenti.ner.core.BracketParseAttr.NO, 100);
                    if (br != null) 
                        tt = br.getEndToken();
                }
                t1 = tt;
            }
            if (t1 == null) 
                break;
            if (t1.getNext() == null) 
                return null;
            if (typ == ResumeItemType.POSITION) {
                boolean ok = false;
                for (com.pullenti.ner.Token tt = t1.getNext(); tt != null; tt = tt.getNext()) {
                    if (tt.isNewlineBefore()) {
                        if (tt.getReferent() instanceof com.pullenti.ner.money.MoneyReferent) 
                            ok = true;
                        else if (tt.isValue("СПЕЦИАЛИЗАЦИЯ", null)) 
                            ok = true;
                        break;
                    }
                }
                if (!ok) 
                    return null;
            }
            com.pullenti.ner.ReferentToken rt1 = _parseDriving(t, ad);
            if (rt1 != null) {
                t = rt1;
                rt = rt1;
                continue;
            }
            com.pullenti.ner.MetaToken mt = _parseMoral(t);
            if (mt != null) {
                ResumeItemReferent mor = new ResumeItemReferent();
                mor.setTyp(ResumeItemType.MORAL);
                mor.setValue(_corrValue((String)com.pullenti.unisharp.Utils.cast(mt.tag, String.class)));
                rt = new com.pullenti.ner.ReferentToken(ad.registerReferent(mor), t, mt.getEndToken(), null);
            }
            else {
                spec = new ResumeItemReferent();
                spec.setTyp(typ);
                if ((t.getLengthChar() == 1 && (t instanceof com.pullenti.ner.TextToken) && !t.chars.isLetter()) && (t.getEndChar() < t1.getBeginChar())) 
                    t = t.getNext();
                for (; t != null; t = t.getNext()) {
                    if (t.isValue("НАВЫК", null) || t.isTableControlChar() || ((t.getLengthChar() == 1 && (t instanceof com.pullenti.ner.TextToken) && !t.chars.isLetter()))) {
                    }
                    else 
                        break;
                }
                if (t == null) 
                    break;
                if (t.getEndChar() > t1.getEndChar()) {
                    t = t1;
                    continue;
                }
                spec.setValue(_corrValue(com.pullenti.ner.core.MiscHelper.getTextValue(t, t1, com.pullenti.ner.core.GetTextAttr.of((com.pullenti.ner.core.GetTextAttr.KEEPQUOTES.value()) | (com.pullenti.ner.core.GetTextAttr.KEEPREGISTER.value())))));
                if (com.pullenti.unisharp.Utils.stringsEq(spec.getValue(), "другое") || com.pullenti.unisharp.Utils.stringsEq(spec.getValue(), "языки") || com.pullenti.unisharp.Utils.stringsEq(spec.getValue(), "курсы")) {
                    t = t1;
                    continue;
                }
                for (com.pullenti.ner.Token tt = t; tt != null && (tt.getEndChar() < t1.getEndChar()); tt = tt.getNext()) {
                    com.pullenti.ner.core.NounPhraseToken npt = com.pullenti.ner.core.NounPhraseHelper.tryParse(tt, com.pullenti.ner.core.NounPhraseParseAttr.NO, 0, null);
                    if (npt != null && npt.adjectives.size() > 0) {
                        if (npt.getEndToken().isValue("УРОВЕНЬ", null) || npt.getEndToken().isValue("НАВЫК", null) || npt.getEndToken().isValue("ЗНАНИЕ", null)) {
                            if (tt != t) {
                                spec.setMisc(npt.getNormalCaseText(null, com.pullenti.morph.MorphNumber.UNDEFINED, com.pullenti.morph.MorphGender.UNDEFINED, false).toLowerCase());
                                if (tt.getPrevious().isCharOf("-(")) 
                                    tt = tt.getPrevious();
                                if (tt.getPrevious().getBeginChar() >= t.getBeginChar()) {
                                    com.pullenti.ner.core.TerminToken tok = com.pullenti.ner.vacance.internal.VacanceToken.M_SKILLITEMS.tryParse(t, com.pullenti.ner.core.TerminParseAttr.NO);
                                    if (tok != null) 
                                        spec.setValue(tok.termin.getCanonicText());
                                    else 
                                        spec.setValue(_corrValue(com.pullenti.ner.core.MiscHelper.getTextValue(t, tt.getPrevious(), com.pullenti.ner.core.GetTextAttr.of((com.pullenti.ner.core.GetTextAttr.KEEPQUOTES.value()) | (com.pullenti.ner.core.GetTextAttr.KEEPREGISTER.value())))));
                                }
                            }
                            else if (npt.getEndChar() < t1.getEndChar()) {
                                spec.setMisc(npt.getNormalCaseText(null, com.pullenti.morph.MorphNumber.UNDEFINED, com.pullenti.morph.MorphGender.UNDEFINED, false).toLowerCase());
                                com.pullenti.ner.core.TerminToken tok = com.pullenti.ner.vacance.internal.VacanceToken.M_SKILLITEMS.tryParse(npt.getEndToken().getNext(), com.pullenti.ner.core.TerminParseAttr.NO);
                                if (tok != null) 
                                    spec.setValue(tok.termin.getCanonicText());
                                else 
                                    spec.setValue(_corrValue(com.pullenti.ner.core.MiscHelper.getTextValue(npt.getEndToken().getNext(), t1, com.pullenti.ner.core.GetTextAttr.of((com.pullenti.ner.core.GetTextAttr.FIRSTNOUNGROUPTONOMINATIVE.value()) | (com.pullenti.ner.core.GetTextAttr.KEEPQUOTES.value()) | (com.pullenti.ner.core.GetTextAttr.KEEPREGISTER.value())))));
                            }
                            break;
                        }
                    }
                }
                if (com.pullenti.unisharp.Utils.isNullOrEmpty(spec.getValue())) {
                    t = t1;
                    continue;
                }
                rt = new com.pullenti.ner.ReferentToken(ad.registerReferent(spec), t, t1, null);
            }
            t.kit.embedToken(rt);
            t = rt;
        }
        return rt;
    }

    private static String _corrValue(String val) {
        if (com.pullenti.unisharp.Utils.isNullOrEmpty(val) || (val.length() < 3)) 
            return val;
        val = val.replace(" - ", "-");
        if (val.endsWith(".")) 
            val = val.substring(0, 0 + val.length() - 1);
        if (Character.isUpperCase(val.charAt(0)) && Character.isLowerCase(val.charAt(1)) && ((int)val.charAt(0)) > 0x100) 
            val = (String.valueOf(Character.toLowerCase(val.charAt(0))) + val.substring(1));
        return val;
    }

    private static com.pullenti.ner.ReferentToken _parseAboutMe(com.pullenti.ner.Token t, com.pullenti.ner.core.AnalyzerData ad) {
        com.pullenti.ner.Token t0 = t;
        com.pullenti.ner.ReferentToken rt = null;
        for (; t != null; t = t.getNext()) {
            if (t.isNewlineBefore()) {
                if (_parseEducation(t) != null) 
                    break;
                if (_startOfItem(t)) 
                    break;
            }
            com.pullenti.ner.MetaToken mt = _parseMoral(t);
            if (mt != null) {
                ResumeItemReferent mor = new ResumeItemReferent();
                mor.setTyp(ResumeItemType.MORAL);
                mor.setValue(_corrValue((String)com.pullenti.unisharp.Utils.cast(mt.tag, String.class)));
                rt = new com.pullenti.ner.ReferentToken(ad.registerReferent(mor), t, mt.getEndToken(), null);
                t.kit.embedToken(rt);
                t = rt;
                continue;
            }
            mt = _parseOnto(t);
            if (mt != null) {
                ResumeItemReferent mor = new ResumeItemReferent();
                mor.setTyp(ResumeItemType.SKILL);
                mor.setValue(_corrValue((String)com.pullenti.unisharp.Utils.cast(mt.tag, String.class)));
                rt = new com.pullenti.ner.ReferentToken(ad.registerReferent(mor), t, mt.getEndToken(), null);
                t.kit.embedToken(rt);
                t = rt;
                continue;
            }
        }
        return rt;
    }

    public static com.pullenti.ner.ReferentToken _parseOrg(com.pullenti.ner.Token t, ResumeItemType typ) {
        com.pullenti.ner.Token t0 = t;
        if (t == null) 
            return null;
        for (; t != null; t = t.getNext()) {
            if (((t.isCharOf(":-") || t.isTableControlChar() || t.isValue("ПЕРИОД", null)) || t.isValue("РАБОТА", null) || t.isValue("ВРЕМЯ", null)) || t.isValue("МЕСТО", null)) {
            }
            else if (((t instanceof com.pullenti.ner.NumberToken) && t.isNewlineBefore() && t.getNext() != null) && t.getNext().isCharOf(".)")) 
                t = t.getNext();
            else 
                break;
        }
        if (t == null) 
            return null;
        com.pullenti.ner._org.OrganizationReferent __org = null;
        com.pullenti.ner.person.PersonPropertyReferent post = null;
        com.pullenti.ner.person.internal.PersonAttrToken postAttr = null;
        com.pullenti.ner.Referent dt = t.getReferent();
        com.pullenti.ner.Token t1 = null;
        if ((dt instanceof com.pullenti.ner.date.DateReferent) || (dt instanceof com.pullenti.ner.date.DateRangeReferent)) {
        }
        else if ((dt instanceof com.pullenti.ner._org.OrganizationReferent) && t0.isNewlineBefore() && t.getNext() != null) {
            __org = (com.pullenti.ner._org.OrganizationReferent)com.pullenti.unisharp.Utils.cast(dt, com.pullenti.ner._org.OrganizationReferent.class);
            dt = null;
            t = t.getNext();
            if (t.isChar('(') && t.getNext() != null) 
                t = t.getNext();
            if ((t.getReferent() instanceof com.pullenti.ner.date.DateReferent) || (t.getReferent() instanceof com.pullenti.ner.date.DateRangeReferent)) {
                dt = t.getReferent();
                t1 = t;
                t = t.getNext();
                if (t != null && t.isChar(')')) {
                    t1 = t;
                    t = t.getNext();
                }
            }
            com.pullenti.ner.person.internal.PersonAttrToken pat = com.pullenti.ner.person.internal.PersonAttrToken.tryAttach(t, com.pullenti.ner.person.internal.PersonAttrToken.PersonAttrAttachAttrs.NO);
            if (pat == null && t != null && (t.getReferent() instanceof com.pullenti.ner.person.PersonPropertyReferent)) 
                pat = com.pullenti.ner.person.internal.PersonAttrToken._new3525(t, t, (com.pullenti.ner.person.PersonPropertyReferent)com.pullenti.unisharp.Utils.cast(t.getReferent(), com.pullenti.ner.person.PersonPropertyReferent.class));
            if (pat == null || pat.getPropRef() == null) {
                if (dt != null && typ != ResumeItemType.UNDEFINED) {
                }
                else 
                    return null;
            }
            else {
                postAttr = pat;
                dt = (com.pullenti.ner.Referent)com.pullenti.unisharp.Utils.cast(pat.getPropRef().getSlotValue(com.pullenti.ner.person.PersonPropertyReferent.ATTR_REF), com.pullenti.ner.Referent.class);
                if (dt == null && pat.getPropRef().getHigher() != null) 
                    dt = (com.pullenti.ner.Referent)com.pullenti.unisharp.Utils.cast(pat.getPropRef().getHigher().getSlotValue(com.pullenti.ner.person.PersonPropertyReferent.ATTR_REF), com.pullenti.ner.Referent.class);
                t1 = pat.getEndToken();
                if ((dt instanceof com.pullenti.ner.date.DateReferent) || (dt instanceof com.pullenti.ner.date.DateRangeReferent)) {
                    pat.getPropRef().addSlot(com.pullenti.ner.person.PersonPropertyReferent.ATTR_REF, null, true, 0);
                    if (pat.getPropRef().getHigher() != null) 
                        pat.getPropRef().getHigher().addSlot(com.pullenti.ner.person.PersonPropertyReferent.ATTR_REF, null, true, 0);
                }
                else if (dt == null) {
                    if (pat.getEndToken().getNext() == null) 
                        return null;
                    dt = pat.getEndToken().getNext().getReferent();
                    if ((dt instanceof com.pullenti.ner.date.DateReferent) || (dt instanceof com.pullenti.ner.date.DateRangeReferent)) {
                    }
                    else 
                        return null;
                    t1 = pat.getEndToken().getNext();
                }
            }
        }
        else 
            return null;
        int cou = 0;
        if (t1 == null) {
            for (t = t.getNext(); t != null && (cou < 3); t = t.getNext()) {
                if (((post != null || postAttr != null)) && __org != null) 
                    break;
                if (t.isNewlineBefore()) 
                    cou++;
                com.pullenti.ner._org.OrganizationReferent r = (com.pullenti.ner._org.OrganizationReferent)com.pullenti.unisharp.Utils.cast(t.getReferent(), com.pullenti.ner._org.OrganizationReferent.class);
                if (r != null) {
                    if (__org != null) {
                        if (r.getHigher() == __org || ((r.getHigher() != null && r.getHigher() == __org))) {
                        }
                        else 
                            break;
                    }
                    __org = r;
                    t1 = t;
                    cou = 0;
                    continue;
                }
                com.pullenti.ner.person.PersonPropertyReferent p = (com.pullenti.ner.person.PersonPropertyReferent)com.pullenti.unisharp.Utils.cast(t.getReferent(), com.pullenti.ner.person.PersonPropertyReferent.class);
                if (p != null && post == null) {
                    post = p;
                    t1 = t;
                    cou = 0;
                    continue;
                }
                if (post == null && postAttr == null) {
                    if (t.isValue("ТЕХНИК", null)) {
                    }
                    com.pullenti.ner.person.internal.PersonAttrToken pat = com.pullenti.ner.person.internal.PersonAttrToken.tryAttach(t, com.pullenti.ner.person.internal.PersonAttrToken.PersonAttrAttachAttrs.NO);
                    if (pat != null && pat.getPropRef() != null) {
                        postAttr = pat;
                        t = (t1 = pat.getEndToken());
                        if (__org == null) {
                            if (pat.higherPropRef != null) 
                                __org = (com.pullenti.ner._org.OrganizationReferent)com.pullenti.unisharp.Utils.cast(pat.higherPropRef.getPropRef().getSlotValue(com.pullenti.ner.person.PersonPropertyReferent.ATTR_REF), com.pullenti.ner._org.OrganizationReferent.class);
                            else 
                                __org = (com.pullenti.ner._org.OrganizationReferent)com.pullenti.unisharp.Utils.cast(pat.getPropRef().getSlotValue(com.pullenti.ner.person.PersonPropertyReferent.ATTR_REF), com.pullenti.ner._org.OrganizationReferent.class);
                        }
                        cou = 0;
                        continue;
                    }
                }
                if ((t.getReferent() instanceof com.pullenti.ner.date.DateReferent) || (t.getReferent() instanceof com.pullenti.ner.date.DateRangeReferent)) 
                    break;
                if ((t instanceof com.pullenti.ner.NumberToken) && t.isNewlineBefore()) {
                    if (t.getNext() != null && t.getNext().isCharOf(".)")) 
                        break;
                    com.pullenti.ner.NumberToken num = (com.pullenti.ner.NumberToken)com.pullenti.unisharp.Utils.cast(t, com.pullenti.ner.NumberToken.class);
                    if (num.getIntValue() != null) {
                        if (num.getIntValue() >= 2000 && num.getIntValue() <= 2050) 
                            break;
                    }
                }
            }
        }
        if (__org == null) 
            return null;
        if (typ == ResumeItemType.UNDEFINED && __org.getProfiles().contains(com.pullenti.ner._org.OrgProfile.EDUCATION)) 
            typ = ResumeItemType.STUDY;
        ResumeItemReferent res = ResumeItemReferent._new3526((typ == ResumeItemType.UNDEFINED ? ResumeItemType.ORGANIZATION : typ));
        res.setDateRange(dt);
        res.setRef(__org);
        if (post == null && postAttr != null) 
            post = postAttr.getPropRef();
        if (post != null) 
            res.setValue(post.toStringEx(true, null, 0));
        return new com.pullenti.ner.ReferentToken(res, t0, t1, null);
    }

    public static com.pullenti.ner.ReferentToken _parseOrg2(com.pullenti.ner.Token t, com.pullenti.ner.core.AnalyzerData ad, java.util.ArrayList<com.pullenti.ner.ReferentToken> links) {
        if (t == null) 
            return null;
        if (!t.isValue2("ОПЫТ", "РАБОТЫ")) 
            return null;
        for (t = t.getNext(); t != null; t = t.getNext()) {
            if (t.isNewlineBefore()) 
                break;
        }
        if (t == null) 
            return null;
        com.pullenti.ner.ReferentToken res = null;
        for (; t != null; t = t.getNext()) {
            if (_startOfItem(t)) 
                break;
            if (!t.isNewlineBefore()) 
                continue;
            com.pullenti.ner.person.PersonPropertyReferent prop = (com.pullenti.ner.person.PersonPropertyReferent)com.pullenti.unisharp.Utils.cast(t.getReferent(), com.pullenti.ner.person.PersonPropertyReferent.class);
            com.pullenti.ner._org.OrganizationReferent __org = null;
            if (prop == null) {
                com.pullenti.ner.person.internal.PersonAttrToken pr = com.pullenti.ner.person.internal.PersonAttrToken.tryAttach(t, com.pullenti.ner.person.internal.PersonAttrToken.PersonAttrAttachAttrs.NO);
                if (pr != null) {
                    prop = pr.getPropRef();
                    t = pr.getEndToken();
                }
            }
            if (prop == null) {
                if (res == null) 
                    break;
                continue;
            }
            com.pullenti.ner.Token t0 = t;
            if (t.getNext() != null && ((t.getNext().isValue("В", null) || t.getNext().isCharOf("-:,")))) 
                t = t.getNext();
            __org = (com.pullenti.ner._org.OrganizationReferent)com.pullenti.unisharp.Utils.cast(prop.getSlotValue(com.pullenti.ner.person.PersonPropertyReferent.ATTR_REF), com.pullenti.ner._org.OrganizationReferent.class);
            if (__org == null) 
                __org = (com.pullenti.ner._org.OrganizationReferent)com.pullenti.unisharp.Utils.cast(t.getReferent(), com.pullenti.ner._org.OrganizationReferent.class);
            if (__org == null) 
                break;
            com.pullenti.ner.ReferentToken dtTok = null;
            for (t = t.getNext(); t != null; t = t.getNext()) {
                if ((t.getReferent() instanceof com.pullenti.ner.date.DateReferent) || (t.getReferent() instanceof com.pullenti.ner.date.DateRangeReferent)) {
                    dtTok = (com.pullenti.ner.ReferentToken)com.pullenti.unisharp.Utils.cast(t, com.pullenti.ner.ReferentToken.class);
                    break;
                }
                if (t.getLengthChar() > 1) 
                    break;
            }
            if (dtTok == null) 
                break;
            ResumeItemReferent it = ResumeItemReferent._new3526(ResumeItemType.ORGANIZATION);
            it.setDateRange(dtTok.referent);
            it.setRef(__org);
            it.setValue(prop.toStringEx(true, null, 0));
            __org.tag = it;
            if (links == null) {
                res = new com.pullenti.ner.ReferentToken(ad.registerReferent(it), t0, dtTok, null);
                t0.kit.embedToken(res);
                t = res;
            }
            else {
                links.add(new com.pullenti.ner.ReferentToken(it, t0, dtTok, null));
                t = dtTok;
            }
        }
        return res;
    }

    private static boolean _checkGeo(com.pullenti.ner.Token t) {
        if (t == null) 
            return false;
        if (t.isValue2("УКАЗАН", "ПРИМЕРНЫЙ")) 
            return true;
        for (com.pullenti.ner.Token tt = t; tt != null; tt = tt.getNext()) {
            if (tt != t && tt.isNewlineBefore()) 
                break;
            com.pullenti.ner.Referent r = tt.getReferent();
            if ((r instanceof com.pullenti.ner.geo.GeoReferent) || (r instanceof com.pullenti.ner.address.StreetReferent) || (r instanceof com.pullenti.ner.address.AddressReferent)) 
                return true;
            if (tt.isValue("ГОТОВ", null) || tt.isValue("ПЕРЕЕЗД", null) || tt.isValue("КОМАНДИРОВКА", null)) 
                return true;
        }
        return false;
    }

    @Override
    public com.pullenti.ner.ReferentToken processOntologyItem(com.pullenti.ner.Token begin) {
        for (com.pullenti.ner.Token t = begin; t != null; t = t.getNext()) {
            if (t.getNext() == null) {
                ResumeItemReferent re = new ResumeItemReferent();
                re.setValue(com.pullenti.ner.core.MiscHelper.getTextValue(begin, t, com.pullenti.ner.core.GetTextAttr.NO));
                return new com.pullenti.ner.ReferentToken(re, begin, t, null);
            }
        }
        return null;
    }

    private static boolean m_Initialized = false;

    private static Object m_Lock;

    public static void initialize() {
        synchronized (m_Lock) {
            if (m_Initialized) 
                return;
            m_Initialized = true;
            MetaResume.initialize();
            com.pullenti.ner.vacance.internal.VacanceToken.initialize();
            com.pullenti.ner.ProcessorService.registerAnalyzer(new ResumeAnalyzer());
        }
    }

    public ResumeAnalyzer() {
        super();
    }
    
    static {
        m_Lock = new Object();
    }
}
