/*
 * 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.address.internal;

public class StreetItemToken extends com.pullenti.ner.MetaToken {

    public StreetItemToken(com.pullenti.ner.Token begin, com.pullenti.ner.Token end) {
        super(begin, end, null);
    }

    public StreetItemType typ = StreetItemType.NOUN;

    public StreetItemType altTyp = StreetItemType.NOUN;

    public com.pullenti.ner.core.Termin termin;

    public com.pullenti.ner.core.Termin altTermin;

    public com.pullenti.ner.address.StreetReferent existStreet;

    public com.pullenti.ner.NumberSpellingType numberType = com.pullenti.ner.NumberSpellingType.UNDEFINED;

    public boolean numberHasPrefix;

    public boolean isNumberKm;

    public String value;

    public String altValue;

    public String altValue2;

    public String misc;

    public boolean isAbridge;

    public boolean isInDictionary;

    public boolean isInBrackets;

    public boolean hasStdSuffix;

    public int nounIsDoubtCoef;

    public boolean nounCanBeName;

    public boolean isRoadName;

    public StreetItemToken stdAdjVersion;

    public StreetItemToken nextItem;

    public boolean isRoad() {
        if (termin == null) 
            return false;
        if (((com.pullenti.unisharp.Utils.stringsEq(termin.getCanonicText(), "АВТОДОРОГА") || com.pullenti.unisharp.Utils.stringsEq(termin.getCanonicText(), "ШОССЕ") || com.pullenti.unisharp.Utils.stringsEq(termin.getCanonicText(), "ТРАКТ")) || com.pullenti.unisharp.Utils.stringsEq(termin.getCanonicText(), "АВТОШЛЯХ") || com.pullenti.unisharp.Utils.stringsEq(termin.getCanonicText(), "ШОСЕ")) || com.pullenti.unisharp.Utils.stringsEq(termin.getCanonicText(), "МАГИСТРАЛЬ") || com.pullenti.unisharp.Utils.stringsEq(termin.getCanonicText(), "МАГІСТРАЛЬ")) 
            return true;
        return false;
    }


    public boolean isRailway;

    public com.pullenti.ner.geo.internal.Condition cond;

    public boolean noGeoInThisToken;

    public com.pullenti.ner.geo.internal.OrgItemToken _org;

    public AddressItemToken ortoTerr;

    public AddressItemToken area;

    public com.pullenti.ner.geo.GeoReferent city;

    public StreetItemToken clone() {
        StreetItemToken res = new StreetItemToken(getBeginToken(), getEndToken());
        res.setMorph(this.getMorph());
        res.typ = typ;
        res.altTyp = altTyp;
        res.termin = termin;
        res.altTermin = altTermin;
        res.value = value;
        res.altValue = altValue;
        res.altValue2 = altValue2;
        res.isRailway = isRailway;
        res.isRoadName = isRoadName;
        res.nounCanBeName = nounCanBeName;
        res.nounIsDoubtCoef = nounIsDoubtCoef;
        res.hasStdSuffix = hasStdSuffix;
        res.isInBrackets = isInBrackets;
        res.isAbridge = isAbridge;
        res.isInDictionary = isInDictionary;
        res.existStreet = existStreet;
        res.misc = misc;
        res.numberType = numberType;
        res.numberHasPrefix = numberHasPrefix;
        res.isNumberKm = isNumberKm;
        res.cond = cond;
        res._org = _org;
        if (ortoTerr != null) 
            res.ortoTerr = ortoTerr.clone();
        res.city = city;
        res.area = area;
        if (stdAdjVersion != null) 
            res.stdAdjVersion = stdAdjVersion.clone();
        if (nextItem != null) 
            res.nextItem = nextItem.clone();
        return res;
    }

    @Override
    public String toString() {
        StringBuilder res = new StringBuilder();
        res.append(typ.toString());
        if (value != null) {
            res.append(" ").append(value);
            if (altValue != null) 
                res.append("/").append(altValue);
            if (isNumberKm) 
                res.append("км");
        }
        if (misc != null) 
            res.append(" <").append(misc).append(">");
        if (existStreet != null) 
            res.append(" ").append(existStreet.toString());
        if (termin != null) {
            res.append(" ").append(termin.toString());
            if (altTermin != null) 
                res.append("/").append(altTermin.toString());
        }
        else 
            res.append(" ").append(super.toString());
        if (_org != null) 
            res.append(" Org: ").append(_org);
        if (isAbridge) 
            res.append(" (?)");
        if (ortoTerr != null) 
            res.append(" TERR: ").append(ortoTerr);
        if (area != null) 
            res.append(" AREA: ").append(area);
        if (stdAdjVersion != null) 
            res.append(" + (?) ").append(stdAdjVersion.toString());
        if (nextItem != null) 
            res.append(" + ").append(nextItem.toString());
        return res.toString();
    }

    private boolean _isSurname() {
        if (typ != StreetItemType.NAME) 
            return false;
        if (!(this.getEndToken() instanceof com.pullenti.ner.TextToken)) 
            return false;
        String nam = ((com.pullenti.ner.TextToken)com.pullenti.unisharp.Utils.cast(this.getEndToken(), com.pullenti.ner.TextToken.class)).term;
        if (nam.length() > 4) {
            if (com.pullenti.morph.LanguageHelper.endsWithEx(nam, "А", "Я", "КО", "ЧУКА")) {
                if (!com.pullenti.morph.LanguageHelper.endsWithEx(nam, "АЯ", "ЯЯ", null, null)) {
                    com.pullenti.morph.MorphClass mc = getEndToken().getMorphClassInDictionary();
                    if (!mc.isNoun()) 
                        return true;
                }
            }
        }
        return false;
    }

    public static boolean SPEEDREGIME = false;

    public static void prepareAllData(com.pullenti.ner.Token t0) {
        if (!SPEEDREGIME) 
            return;
        com.pullenti.ner.geo.internal.GeoAnalyzerData ad = com.pullenti.ner.geo.GeoAnalyzer.getData(t0);
        if (ad == null) 
            return;
        ad.sRegime = false;
        for (com.pullenti.ner.Token t = t0; t != null; t = t.getNext()) {
            com.pullenti.ner.geo.internal.GeoTokenData d = (com.pullenti.ner.geo.internal.GeoTokenData)com.pullenti.unisharp.Utils.cast(t.tag, com.pullenti.ner.geo.internal.GeoTokenData.class);
            StreetItemToken prev = null;
            int kk = 0;
            for (com.pullenti.ner.Token tt = t.getPrevious(); tt != null && (kk < 10); tt = tt.getPrevious(),kk++) {
                com.pullenti.ner.geo.internal.GeoTokenData dd = (com.pullenti.ner.geo.internal.GeoTokenData)com.pullenti.unisharp.Utils.cast(tt.tag, com.pullenti.ner.geo.internal.GeoTokenData.class);
                if (dd == null || dd.street == null) 
                    continue;
                if (dd.street.getEndToken().getNext() == t) 
                    prev = dd.street;
                if (t.getPrevious() != null && t.getPrevious().isHiphen() && dd.street.getEndToken().getNext() == t.getPrevious()) 
                    prev = dd.street;
            }
            StreetItemToken str = tryParse(t, prev, false, ad);
            if (str != null) {
                if (d == null) 
                    d = new com.pullenti.ner.geo.internal.GeoTokenData(t);
                d.street = str;
                if (str.noGeoInThisToken) {
                    if (((prev != null && prev.typ == StreetItemType.NOUN)) || StreetItemToken.checkKeyword(str.getEndToken().getNext())) {
                        for (com.pullenti.ner.Token tt = str.getBeginToken(); tt != null && tt.getEndChar() <= str.getEndChar(); tt = tt.getNext()) {
                            com.pullenti.ner.geo.internal.GeoTokenData dd = (com.pullenti.ner.geo.internal.GeoTokenData)com.pullenti.unisharp.Utils.cast(tt.tag, com.pullenti.ner.geo.internal.GeoTokenData.class);
                            if (dd == null) 
                                dd = new com.pullenti.ner.geo.internal.GeoTokenData(tt);
                            dd.noGeo = true;
                        }
                    }
                }
                if (str.misc != null && str.getBeginToken() != str.getEndToken()) {
                    for (com.pullenti.ner.Token tt = str.getBeginToken(); tt != null && tt.getEndChar() <= str.getEndChar(); tt = tt.getNext()) {
                        com.pullenti.ner.geo.internal.GeoTokenData dd = (com.pullenti.ner.geo.internal.GeoTokenData)com.pullenti.unisharp.Utils.cast(tt.tag, com.pullenti.ner.geo.internal.GeoTokenData.class);
                        if (dd == null) 
                            dd = new com.pullenti.ner.geo.internal.GeoTokenData(tt);
                        dd.noCity = true;
                    }
                }
            }
        }
        ad.sRegime = true;
    }

    public static StreetItemToken tryParse(com.pullenti.ner.Token t, StreetItemToken prev, boolean inSearch, com.pullenti.ner.geo.internal.GeoAnalyzerData ad) {
        if (t == null) 
            return null;
        if ((t instanceof com.pullenti.ner.TextToken) && t.getLengthChar() == 1 && t.isCharOf(",.:")) 
            return null;
        if (ad == null) 
            ad = (com.pullenti.ner.geo.internal.GeoAnalyzerData)com.pullenti.unisharp.Utils.cast(com.pullenti.ner.geo.GeoAnalyzer.getData(t), com.pullenti.ner.geo.internal.GeoAnalyzerData.class);
        if (ad == null) 
            return null;
        if ((SPEEDREGIME && ((ad.sRegime || ad.allRegime)) && !inSearch) && !(t instanceof com.pullenti.ner.ReferentToken)) {
            if ((t instanceof com.pullenti.ner.TextToken) && t.isChar('м')) {
            }
            else {
                com.pullenti.ner.geo.internal.GeoTokenData d = (com.pullenti.ner.geo.internal.GeoTokenData)com.pullenti.unisharp.Utils.cast(t.tag, com.pullenti.ner.geo.internal.GeoTokenData.class);
                if (d == null) 
                    return null;
                if (d.street != null) {
                    if (d.street.cond == null || d.noCity) 
                        return d.street;
                    if (d.street.cond.check()) 
                        return d.street;
                    return null;
                }
                if (d._org != null) 
                    return _new86(t, d._org.getEndToken(), StreetItemType.FIX, d._org);
                return null;
            }
        }
        if (ad.sLevel > 3) 
            return null;
        ad.sLevel++;
        StreetItemToken res = _tryParse(t, false, prev, inSearch);
        if (res != null && res.typ != StreetItemType.NOUN) {
            if (res.typ == StreetItemType.NAME && res.getBeginToken() == res.getEndToken() && (res.getBeginToken() instanceof com.pullenti.ner.TextToken)) {
                com.pullenti.ner.TextToken tt2 = (com.pullenti.ner.TextToken)com.pullenti.unisharp.Utils.cast(res.getBeginToken(), com.pullenti.ner.TextToken.class);
                if (com.pullenti.unisharp.Utils.stringsEq(tt2.term, "ИЖС") || com.pullenti.unisharp.Utils.stringsEq(tt2.term, "ЛПХ") || com.pullenti.unisharp.Utils.stringsEq(tt2.term, "ДУБЛЬ")) {
                    ad.sLevel--;
                    return null;
                }
                AddressItemToken ait = AddressItemToken.tryParsePureItem(t, null, null);
                if ((ait != null && ait.getTyp() == AddressItemType.HOUSE && ait.value != null) && com.pullenti.unisharp.Utils.stringsNe(ait.value, "0")) {
                    ad.sLevel--;
                    return null;
                }
            }
            com.pullenti.ner.TextToken tt = (com.pullenti.ner.TextToken)com.pullenti.unisharp.Utils.cast(res.getEndToken().getNext(), com.pullenti.ner.TextToken.class);
            if (tt != null && res.typ == StreetItemType.NUMBER && tt.isValue("ОТДЕЛЕНИЕ", null)) {
                res.setEndToken(tt);
                res.numberHasPrefix = true;
            }
            else if (tt != null && res.typ == StreetItemType.NUMBER && tt.isChar('+')) {
                StreetItemToken res2 = _tryParse(tt.getNext(), false, prev, inSearch);
                if (res2 != null && res2.typ == StreetItemType.NUMBER) {
                    res.setEndToken(res2.getEndToken());
                    res.value = (res.value + "+" + res2.value);
                }
            }
            else if (tt != null && tt.isChar('(')) {
                if (res.value == null) 
                    res.value = com.pullenti.ner.core.MiscHelper.getTextValue(res.getBeginToken(), res.getEndToken(), com.pullenti.ner.core.GetTextAttr.NO);
                AddressItemToken ait = AddressItemToken.tryParse(tt.getNext(), false, null, null);
                if ((ait != null && ait.getTyp() == AddressItemType.STREET && ait.getEndToken().getNext() != null) && ait.getEndToken().getNext().isChar(')')) {
                    res.ortoTerr = ait.clone();
                    res.ortoTerr.setEndToken(ait.getEndToken().getNext());
                    res.setEndToken(res.ortoTerr.getEndToken());
                    if (res.typ == StreetItemType.NUMBER && res.getEndToken().getNext() != null) {
                        if (res.getEndToken().getNext().isValue("КИЛОМЕТР", null) && res.value != null) {
                            res.isNumberKm = true;
                            res.setEndToken(res.getEndToken().getNext());
                        }
                    }
                }
                else {
                    StreetItemToken sit = StreetItemToken.tryParse(tt.getNext(), null, false, null);
                    if ((sit != null && ((sit.typ == StreetItemType.NAME || sit.typ == StreetItemType.STDNAME)) && sit.getEndToken().getNext() != null) && sit.getEndToken().getNext().isChar(')')) {
                        com.pullenti.ner.geo.internal.OrgTypToken oty = com.pullenti.ner.geo.internal.OrgTypToken.tryParse(tt.getNext(), false, null);
                        if (oty != null && oty.getEndToken() == sit.getEndToken()) 
                            res.setEndToken(sit.getEndToken().getNext());
                        else {
                            ait = new AddressItemToken(AddressItemType.STREET, tt.getNext(), sit.getEndToken());
                            com.pullenti.ner.address.StreetReferent stre = new com.pullenti.ner.address.StreetReferent();
                            stre.setKind(com.pullenti.ner.address.StreetKind.AREA);
                            stre.addTyp("территория");
                            stre.addName(sit);
                            ait.referent = stre;
                            res.ortoTerr = ait;
                            res.setEndToken(sit.getEndToken().getNext());
                        }
                    }
                }
            }
            if (res.getBeginToken() == res.getEndToken() && ((res.typ == StreetItemType.NAME || res.typ == StreetItemType.STDNAME || res.typ == StreetItemType.STDPARTOFNAME))) {
                com.pullenti.ner.Token end = com.pullenti.ner.geo.internal.MiscLocationHelper.checkNameLong(res);
                if ((end instanceof com.pullenti.ner.ReferentToken) && (end.getReferent() instanceof com.pullenti.ner.date.DateReferent)) 
                    end = null;
                if (end != null) {
                    com.pullenti.ner.core.TerminToken tok = m_Ontology.tryParse(end, com.pullenti.ner.core.TerminParseAttr.NO);
                    if (tok != null) {
                        if (((StreetItemType)tok.termin.tag) == StreetItemType.NOUN || ((StreetItemType)tok.termin.tag) == StreetItemType.STDPARTOFNAME) 
                            end = null;
                    }
                }
                if (end != null) {
                    res.setEndToken(end);
                    if (res.value == null) 
                        res.value = com.pullenti.ner.core.MiscHelper.getTextValue(res.getBeginToken(), end, com.pullenti.ner.core.GetTextAttr.NO);
                    else {
                        res.value = (res.value + " " + com.pullenti.ner.core.MiscHelper.getTextValue(res.getBeginToken().getNext(), end, com.pullenti.ner.core.GetTextAttr.NO));
                        if (res.altValue != null) 
                            res.altValue = (res.altValue + " " + com.pullenti.ner.core.MiscHelper.getTextValue(res.getBeginToken().getNext(), end, com.pullenti.ner.core.GetTextAttr.NO));
                    }
                    if (res.getBeginToken().getNext() == res.getEndToken()) {
                        com.pullenti.morph.MorphClass mc = res.getBeginToken().getMorphClassInDictionary();
                        com.pullenti.morph.MorphClass mc1 = res.getEndToken().getMorphClassInDictionary();
                        if (((mc.isProperName() && !res.getBeginToken().isValue("СЛАВА", null))) || mc1.isProperSurname()) {
                            res.altValue2 = res.altValue;
                            res.altValue = com.pullenti.ner.core.MiscHelper.getTextValue(end, end, com.pullenti.ner.core.GetTextAttr.NO);
                        }
                        else if (mc.isProperSurname() && mc1.isProperName()) {
                            res.altValue2 = res.altValue;
                            res.altValue = com.pullenti.ner.core.MiscHelper.getTextValue(res.getBeginToken(), res.getBeginToken(), com.pullenti.ner.core.GetTextAttr.NO);
                        }
                    }
                }
            }
        }
        if (res != null && res.isRoad()) {
            for (com.pullenti.ner.Token tt = res.getEndToken().getNext(); tt != null; 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) {
                    if (npt.getEndToken().isValue("ПОЛЬЗОВАНИЕ", null) || npt.getEndToken().isValue("ЗНАЧЕНИЕ", null)) {
                        res.setEndToken((tt = npt.getEndToken()));
                        continue;
                    }
                }
                break;
            }
        }
        if ((res == null && t.isChar('(') && com.pullenti.ner.geo.internal.MiscLocationHelper.isUserParamAddress(t)) && m_Ontology.tryParse(t.getNext(), com.pullenti.ner.core.TerminParseAttr.NO) != null) {
            StreetItemToken _next = tryParse(t.getNext(), null, false, null);
            if ((_next != null && _next.typ == StreetItemType.NOUN && _next.getEndToken().getNext() != null) && _next.getEndToken().getNext().isChar(')')) {
                _next.setBeginToken(t);
                _next.setEndToken(_next.getEndToken().getNext());
                res = _next;
            }
        }
        ad.sLevel--;
        return res;
    }

    public static StreetItemToken _tryParse(com.pullenti.ner.Token t, boolean ignoreOnto, StreetItemToken prev, boolean inSearch) {
        if (t == null) 
            return null;{
                java.util.ArrayList<StreetItemToken> res1 = tryParseSpec(t, prev);
                if (res1 != null) {
                    if (res1.get(0).typ == StreetItemType.NAME || res1.get(0).typ == StreetItemType.STDNAME) 
                        return res1.get(0);
                    if (res1.size() == 1 && res1.get(0).typ == StreetItemType.NUMBER && res1.get(0).numberHasPrefix) 
                        return res1.get(0);
                }
            }
        if ((prev == null && t.getNext() != null && t.getNext().isHiphen()) && com.pullenti.ner.geo.internal.MiscLocationHelper.isUserParamAddress(t)) {
            java.util.ArrayList<StreetItemToken> res1 = tryParseSpec(t, prev);
            if (res1 != null && res1.get(0).typ == StreetItemType.NAME) 
                return res1.get(0);
        }
        if (t.isValue("ТЕР", null)) {
        }
        if ((t.isValue("А", null) || t.isValue("АД", null) || t.isValue("АВТ", null)) || t.isValue("АВТОДОР", null)) {
            com.pullenti.ner.Token tt1 = t;
            if (t.isValue("А", null)) {
                tt1 = t.getNext();
                if (tt1 != null && tt1.isCharOf("\\/")) 
                    tt1 = tt1.getNext();
                else if ((tt1 != null && !tt1.isWhitespaceAfter() && tt1.isCharOf(",.")) && com.pullenti.ner.geo.internal.MiscLocationHelper.isUserParamAddress(tt1)) 
                    tt1 = tt1.getNext();
                if (tt1 != null && ((tt1.isValue("Д", null) || tt1.isValue("М", null)))) {
                    if (tt1.getNext() != null && tt1.getNext().isChar('.')) 
                        tt1 = tt1.getNext();
                }
                else 
                    tt1 = null;
            }
            else if (tt1.getNext() != null && tt1.getNext().isChar('.')) 
                tt1 = tt1.getNext();
            if (tt1 != null) {
                if (t == tt1 && (t.getLengthChar() < 5) && !com.pullenti.ner.geo.internal.MiscLocationHelper.isUserParamAddress(t)) {
                }
                else {
                    StreetItemToken res = _new296(t, tt1, StreetItemType.NOUN, m_Road);
                    if (res.getLengthChar() >= 4) 
                        return res;
                    if (prev != null && ((prev.isRoadName || prev.isRoad()))) 
                        return res;
                    StreetItemToken _next = tryParse(tt1.getNext(), res, false, null);
                    if (_next != null && _next.isRoadName) 
                        return res;
                    if (t.getPrevious() != null) {
                        if (t.getPrevious().isValue("КМ", null) || t.getPrevious().isValue("КИЛОМЕТР", null)) 
                            return res;
                    }
                }
            }
        }
        if ((((t.isValue("Ж", null) || t.isValue("ЖЕЛ", null))) && t.getNext() != null && t.getNext().isCharOf("\\/")) && (t.getNext().getNext() instanceof com.pullenti.ner.TextToken) && t.getNext().getNext().isValue("ДОРОЖНЫЙ", null)) 
            return _new285(t, t.getNext().getNext(), StreetItemType.NAME, "ЖЕЛЕЗНО" + ((com.pullenti.ner.TextToken)com.pullenti.unisharp.Utils.cast(t.getNext().getNext(), com.pullenti.ner.TextToken.class)).term);
        if ((((t.isValue("ФЕДЕРАЛЬНЫЙ", null) || t.isValue("ГОСУДАРСТВЕННЫЙ", null) || t.isValue("АВТОМОБИЛЬНЫЙ", null)) || t.isValue("ФЕД", null) || t.isValue("ФЕДЕРАЛ", null)) || t.isValue("ГОС", null) || t.isValue("АВТО", null)) || t.isValue("АВТОМОБ", null)) {
            com.pullenti.ner.Token tt2 = t.getNext();
            if (tt2 != null && tt2.isChar('.')) 
                tt2 = tt2.getNext();
            com.pullenti.ner.core.TerminToken tok2 = m_Ontology.tryParse(tt2, com.pullenti.ner.core.TerminParseAttr.NO);
            if (tok2 != null && ((com.pullenti.unisharp.Utils.stringsEq(tok2.termin.getCanonicText(), "АВТОДОРОГА") || com.pullenti.unisharp.Utils.stringsEq(tok2.termin.getCanonicText(), "МАГИСТРАЛЬ")))) 
                return _new296(t, tok2.getEndToken(), StreetItemType.NOUN, tok2.termin);
        }
        if (t.isHiphen() && prev != null && prev.typ == StreetItemType.NAME) {
            com.pullenti.ner.NumberToken num = com.pullenti.ner.core.NumberHelper.tryParseRoman(t.getNext());
            if (num != null) 
                return _new299(t, num.getEndToken(), StreetItemType.NUMBER, num.getValue(), true);
        }
        if (t.isValue("НОЛЬ", null) || t.isValue("НУЛЬ", null)) {
            if (t.getNext() instanceof com.pullenti.ner.NumberToken) 
                return _new285(t, t.getNext(), StreetItemType.NUMBER, "0" + ((com.pullenti.ner.NumberToken)com.pullenti.unisharp.Utils.cast(t.getNext(), com.pullenti.ner.NumberToken.class)).getValue());
        }
        if (t.isNewlineBefore()) {
            if (t.isValue("ТАБЛИЦА", null) || t.isValue("РИСУНОК", null) || t.isValue("ФОРМУЛА", null)) 
                return null;
        }
        com.pullenti.ner.Token t0 = t;
        com.pullenti.ner.Token tn = null;
        com.pullenti.ner.geo.internal.OrgItemToken org1 = com.pullenti.ner.geo.internal.OrgItemToken.tryParse(t, null);
        if (org1 != null) {
            if (org1.isBuilding) 
                return null;
            if (org1.isGsk || !org1.isDoubt || org1.hasTerrKeyword) 
                return _new86(t0, org1.getEndToken(), StreetItemType.FIX, org1);
            if (com.pullenti.ner.core.BracketHelper.isBracket(t, true)) {
                StreetItemToken _next = tryParse(t.getNext(), prev, false, null);
                if (_next != null) {
                    if (com.pullenti.ner.core.BracketHelper.isBracket(_next.getEndToken().getNext(), true)) {
                        if (_next.typ == StreetItemType.NAME && _next.value == null) 
                            _next.value = com.pullenti.ner.core.MiscHelper.getTextValueOfMetaToken(_next, com.pullenti.ner.core.GetTextAttr.NO);
                        _next.setBeginToken(t0);
                        _next.setEndToken(_next.getEndToken().getNext());
                    }
                    return _next;
                }
            }
        }
        com.pullenti.ner.geo.GeoReferent geo1 = (com.pullenti.ner.geo.GeoReferent)com.pullenti.unisharp.Utils.cast(t.getReferent(), com.pullenti.ner.geo.GeoReferent.class);
        if (geo1 != null && geo1.isCity() && com.pullenti.ner.geo.internal.MiscLocationHelper.isUserParamAddress(t)) {
            for (String ty : geo1.getTyps()) {
                if ((com.pullenti.unisharp.Utils.stringsEq(ty, "поселок") || com.pullenti.unisharp.Utils.stringsEq(ty, "станция") || com.pullenti.unisharp.Utils.stringsEq(ty, "слобода")) || com.pullenti.unisharp.Utils.stringsEq(ty, "хутор")) 
                    return _new302(t0, t, StreetItemType.FIX, geo1);
            }
        }
        if (t instanceof com.pullenti.ner.TextToken) {
            if (t.isValue("ТЕРРИТОРИЯ", null) || com.pullenti.unisharp.Utils.stringsEq(((com.pullenti.ner.TextToken)com.pullenti.unisharp.Utils.cast(t, com.pullenti.ner.TextToken.class)).term, "ТЕР") || com.pullenti.unisharp.Utils.stringsEq(((com.pullenti.ner.TextToken)com.pullenti.unisharp.Utils.cast(t, com.pullenti.ner.TextToken.class)).term, "ТЕРР")) 
                return null;
        }
        com.pullenti.ner.geo.internal.NumToken nnn2 = com.pullenti.ner.geo.internal.NumToken.tryParse(t, com.pullenti.ner.geo.internal.GeoTokenType.STREET);
        if (nnn2 != null && ((nnn2.hasPrefix || nnn2.isCadasterNumber))) 
            return _new303(t, nnn2.getEndToken(), nnn2.value, StreetItemType.NUMBER, true);
        if (prev != null) {
        }
        boolean hasNamed = false;
        if (t.isValue("ИМЕНИ", "ІМЕНІ")) 
            tn = t;
        else if (t.isValue("ПАМЯТИ", "ПАМЯТІ")) {
            com.pullenti.ner.geo.internal.NameToken nam = com.pullenti.ner.geo.internal.NameToken.tryParse(t, com.pullenti.ner.geo.internal.GeoTokenType.STREET, 0, false);
            if (nam != null && nam.getEndToken() != t && nam.number == null) {
            }
            else if (t.isNewlineAfter() || ((t.getNext() != null && t.getNext().isComma()))) {
            }
            else 
                tn = t;
        }
        else if (t.isValue("ИМ", null) || t.isValue("ІМ", null)) {
            tn = t;
            if (tn.getNext() != null && tn.getNext().isChar('.')) 
                tn = tn.getNext();
        }
        if (tn != null) {
            if (tn.getNext() == null || tn.getNewlinesAfterCount() > 1) 
                return null;
            t = tn.getNext();
            tn = t;
            hasNamed = true;
        }
        if (t.isValue("ДВАЖДЫ", null) || t.isValue("ТРИЖДЫ", null) || t.isValue("ЧЕТЫРЕЖДЫ", null)) {
            if (t.getNext() != null) 
                t = t.getNext();
        }
        if (t.isValue("ГЕРОЙ", null)) {
            if ((t instanceof com.pullenti.ner.TextToken) && com.pullenti.unisharp.Utils.stringsEq(((com.pullenti.ner.TextToken)com.pullenti.unisharp.Utils.cast(t, com.pullenti.ner.TextToken.class)).term, "ГЕРОЕВ")) {
            }
            else {
                java.util.ArrayList<com.pullenti.ner.geo.internal.TerrItemToken> ters = com.pullenti.ner.geo.internal.TerrItemToken.tryParseList(t.getNext(), 3, null);
                if (ters != null && ters.size() > 0) {
                    com.pullenti.ner.Token tt1 = null;
                    if (ters.get(0).ontoItem != null) 
                        tt1 = ters.get(0).getEndToken().getNext();
                    else if (ters.get(0).terminItem != null && ters.size() > 1 && ters.get(1).ontoItem != null) 
                        tt1 = ters.get(1).getEndToken().getNext();
                    StreetItemToken nnn = tryParse(tt1, prev, inSearch, null);
                    if (nnn != null && nnn.typ == StreetItemType.NAME) 
                        return nnn;
                }
            }
        }
        if (t.isValue("БОЙЦОВ", null)) {
            if ((t.getNext() instanceof com.pullenti.ner.NumberToken) && (t.getNext().getNext() instanceof com.pullenti.ner.TextToken) && t.getNext().getNext().getMorph().getCase().isGenitive()) 
                return _new285(t, t.getNext(), StreetItemType.NUMBER, ((com.pullenti.ner.NumberToken)com.pullenti.unisharp.Utils.cast(t.getNext(), com.pullenti.ner.NumberToken.class)).getValue());
        }
        if (t.isValue("НЕЗАВИСИМОСТЬ", null)) {
            java.util.ArrayList<com.pullenti.ner.geo.internal.TerrItemToken> ters = com.pullenti.ner.geo.internal.TerrItemToken.tryParseList(t.getNext(), 3, null);
            if (ters != null && ters.size() > 0) {
                com.pullenti.ner.geo.internal.TerrItemToken tok2 = null;
                if (ters.get(0).ontoItem != null) 
                    tok2 = ters.get(0);
                else if (ters.get(0).terminItem != null && ters.size() > 1 && ters.get(1).ontoItem != null) 
                    tok2 = ters.get(1);
                if (tok2 != null) {
                    StreetItemToken res = _new305(t, tok2.getEndToken(), StreetItemType.NAME);
                    res.value = ("НЕЗАВИСИМОСТИ " + tok2.ontoItem.getCanonicText());
                    return res;
                }
            }
        }
        if (t.isValue("ЖУКОВА", null)) {
        }
        if (t instanceof com.pullenti.ner.ReferentToken) {
            java.util.ArrayList<StreetItemToken> res1 = tryParseSpec(t, prev);
            if (res1 != null && ((res1.size() == 1 || res1.get(0).typ == StreetItemType.NAME))) 
                return res1.get(0);
            if ((res1 != null && res1.size() == 2 && res1.get(0).typ == StreetItemType.NUMBER) && ((res1.get(1).typ == StreetItemType.NAME || res1.get(1).typ == StreetItemType.STDNAME))) {
                res1.get(0).nextItem = res1.get(1);
                return res1.get(0);
            }
        }
        com.pullenti.ner.NumberToken nt = com.pullenti.ner.core.NumberHelper.tryParseAge(t);
        if (nt != null && nt.getIntValue() != null) 
            return _new306(nt.getBeginToken(), nt.getEndToken(), StreetItemType.AGE, nt.getValue(), com.pullenti.ner.NumberSpellingType.AGE);
        if ((((nt = (com.pullenti.ner.NumberToken)com.pullenti.unisharp.Utils.cast(t, com.pullenti.ner.NumberToken.class)))) != null) {
            if (((com.pullenti.ner.NumberToken)com.pullenti.unisharp.Utils.cast(nt, com.pullenti.ner.NumberToken.class)).getIntValue() == null) {
                if (prev != null && prev.typ == StreetItemType.NOUN) {
                }
                else 
                    return null;
            }
            else if (((com.pullenti.ner.NumberToken)com.pullenti.unisharp.Utils.cast(nt, com.pullenti.ner.NumberToken.class)).getIntValue() == 0) {
                if (prev != null && prev.typ == StreetItemType.NOUN) {
                }
                else {
                    StreetItemToken _next = tryParse(nt.getNext(), null, false, null);
                    if (_next != null && _next.typ == StreetItemType.NOUN) {
                    }
                    else 
                        return null;
                }
            }
            StreetItemToken res = _new307(nt, nt, StreetItemType.NUMBER, nt.getValue(), nt.typ, nt.getMorph());
            res.value = nt.getValue();
            com.pullenti.ner.geo.internal.NumToken nnn = com.pullenti.ner.geo.internal.NumToken.tryParse(t, com.pullenti.ner.geo.internal.GeoTokenType.STREET);
            if (nnn != null) {
                res.value = nnn.value;
                t = res.setEndToken(nnn.getEndToken());
                if ((nnn.value.indexOf('-') > 0 && prev != null && prev.typ == StreetItemType.NOUN) && com.pullenti.unisharp.Utils.stringsEq(prev.termin.getCanonicText(), "МИКРОРАЙОН")) {
                    int jj = nnn.value.indexOf('-');
                    for (com.pullenti.ner.Token tt2 = nnn.getBeginToken().getNext(); tt2 != null && (tt2.getEndChar() < nnn.getEndChar()); tt2 = tt2.getNext()) {
                        if (tt2.isHiphen()) {
                            t = res.setEndToken(tt2.getPrevious());
                            res.value = res.value.substring(0, 0 + jj);
                            return res;
                        }
                    }
                }
            }
            com.pullenti.ner.core.NumberExToken nex = com.pullenti.ner.core.NumberHelper.tryParseNumberWithPostfix(t);
            if (nex != null) {
                if (nex.exTyp == com.pullenti.ner.core.NumberExType.KILOMETER) {
                    res.isNumberKm = true;
                    res.setEndToken(nex.getEndToken());
                    if (res.value.startsWith("0") && res.value.length() > 1) 
                        res.value = res.value.substring(1);
                    com.pullenti.ner.Token tt2 = res.getEndToken().getNext();
                    boolean hasBr = false;
                    while (tt2 != null) {
                        if (tt2.isHiphen() || tt2.isChar('+')) 
                            tt2 = tt2.getNext();
                        else if (tt2.isChar('(')) {
                            hasBr = true;
                            tt2 = tt2.getNext();
                        }
                        else 
                            break;
                    }
                    com.pullenti.ner.core.NumberExToken nex2 = com.pullenti.ner.core.NumberHelper.tryParseNumberWithPostfix(tt2);
                    if (nex2 != null && nex2.exTyp == com.pullenti.ner.core.NumberExType.METER) {
                        res.setEndToken(nex2.getEndToken());
                        if (hasBr && res.getEndToken().getNext() != null && res.getEndToken().getNext().isChar(')')) 
                            res.setEndToken(res.getEndToken().getNext());
                        String mm = com.pullenti.ner.core.NumberHelper.doubleToString(nex2.getRealValue() / (1000.0));
                        if (mm.startsWith("0.")) 
                            res.value += mm.substring(1);
                    }
                    AddressItemToken ait = AddressItemToken.tryParsePureItem(t, null, null);
                    if (ait != null && ait.getTyp() == AddressItemType.DETAIL) 
                        return null;
                }
                else {
                    StreetItemToken nex2 = tryParse(res.getEndToken().getNext(), null, false, null);
                    if (nex2 != null && nex2.typ == StreetItemType.NOUN && nex2.getEndChar() > nex.getEndChar()) {
                    }
                    else 
                        return null;
                }
            }
            if (t.getNext() != null && t.getNext().isHiphen() && (t.getNext().getNext() instanceof com.pullenti.ner.NumberToken)) {
                nex = com.pullenti.ner.core.NumberHelper.tryParseNumberWithPostfix(t.getNext().getNext());
                if (nex != null) {
                    if (nex.exTyp == com.pullenti.ner.core.NumberExType.KILOMETER) {
                        res.isNumberKm = true;
                        res.setEndToken(nex.getEndToken());
                        res.value = (res.value + "-" + nex.getValue());
                    }
                    else 
                        return null;
                }
            }
            AddressItemToken aaa = AddressItemToken.tryParsePureItem(t, null, null);
            if (aaa != null && aaa.getTyp() == AddressItemType.NUMBER && aaa.getEndChar() > (t.getEndChar() + 1)) {
                StreetItemToken _next = tryParse(res.getEndToken().getNext(), null, false, null);
                if (_next != null && ((_next.typ == StreetItemType.NAME || _next.typ == StreetItemType.STDNAME))) {
                }
                else if (prev != null && prev.typ == StreetItemType.NOUN && (((t.getNext().isHiphen() || com.pullenti.unisharp.Utils.stringsEq(prev.termin.getCanonicText(), "КВАРТАЛ") || com.pullenti.unisharp.Utils.stringsEq(prev.termin.getCanonicText(), "ЛИНИЯ")) || com.pullenti.unisharp.Utils.stringsEq(prev.termin.getCanonicText(), "АЛЛЕЯ") || com.pullenti.unisharp.Utils.stringsEq(prev.termin.getCanonicText(), "ДОРОГА")))) {
                    if (m_Ontology.tryParse(aaa.getEndToken(), com.pullenti.ner.core.TerminParseAttr.NO) != null) {
                    }
                    else {
                        res.setEndToken(aaa.getEndToken());
                        res.value = aaa.value;
                        res.numberType = com.pullenti.ner.NumberSpellingType.UNDEFINED;
                    }
                }
                else 
                    return null;
            }
            if (nt.typ == com.pullenti.ner.NumberSpellingType.WORDS && nt.getMorph()._getClass().isAdjective()) {
                com.pullenti.ner.core.NounPhraseToken npt2 = com.pullenti.ner.geo.internal.MiscLocationHelper.tryParseNpt(t);
                if (npt2 != null && npt2.getEndChar() > t.getEndChar() && npt2.getMorph().getNumber() != com.pullenti.morph.MorphNumber.SINGULAR) {
                    if (t.getNext() != null && !t.getNext().chars.isAllLower()) {
                    }
                    else if (checkKeyword(t.getNext())) {
                    }
                    else 
                        return null;
                }
            }
            if (!res.isNumberKm && prev != null && prev.getBeginToken().isValue("КИЛОМЕТР", null)) 
                res.isNumberKm = true;
            else if (prev != null && prev.typ == StreetItemType.NOUN && !res.isWhitespaceAfter()) {
                for (com.pullenti.ner.Token tt1 = res.getEndToken().getNext(); tt1 != null; tt1 = tt1.getNext()) {
                    if (tt1.isWhitespaceBefore()) 
                        break;
                    if (tt1 instanceof com.pullenti.ner.NumberToken) {
                        res.value += ((com.pullenti.ner.NumberToken)com.pullenti.unisharp.Utils.cast(tt1, com.pullenti.ner.NumberToken.class)).getValue();
                        res.setEndToken(tt1);
                    }
                    else if (tt1.isHiphen()) {
                        res.value += "-";
                        res.setEndToken(tt1);
                    }
                    else if ((tt1 instanceof com.pullenti.ner.TextToken) && tt1.chars.isLetter() && tt1.getLengthChar() == 1) {
                        char ch = ((com.pullenti.ner.TextToken)com.pullenti.unisharp.Utils.cast(tt1, com.pullenti.ner.TextToken.class)).term.charAt(0);
                        char ch1 = com.pullenti.morph.LanguageHelper.getCyrForLat(ch);
                        if (((int)ch1) != 0) 
                            ch = ch1;
                        res.value = (res.value + ch);
                        res.setEndToken(tt1);
                    }
                    else 
                        break;
                }
            }
            if (res.value.endsWith("-")) 
                res.value = res.value.substring(0, 0 + res.value.length() - 1);
            if (res.getEndToken().getNext() != null && ((res.getEndToken().getNext().isValue("СЕКТОР", null) || res.getEndToken().getNext().isValue("ЗОНА", null)))) {
                com.pullenti.ner.Token tt1 = res.getEndToken().getNext().getNext();
                if ((tt1 instanceof com.pullenti.ner.TextToken) && tt1.getLengthChar() == 1 && tt1.chars.isLetter()) {
                    char ch = ((com.pullenti.ner.TextToken)com.pullenti.unisharp.Utils.cast(tt1, com.pullenti.ner.TextToken.class)).term.charAt(0);
                    char ch1 = com.pullenti.morph.LanguageHelper.getCyrForLat(ch);
                    if (((int)ch1) != 0) 
                        ch = ch1;
                    res.value = (res.value + ch);
                    res.setEndToken(tt1);
                }
                else if (tt1 instanceof com.pullenti.ner.NumberToken) {
                    res.value = (res.value + "-" + ((com.pullenti.ner.NumberToken)com.pullenti.unisharp.Utils.cast(tt1, com.pullenti.ner.NumberToken.class)).getValue());
                    res.setEndToken(tt1);
                }
            }
            return res;
        }
        com.pullenti.ner.Token ntt = com.pullenti.ner.core.MiscHelper.checkNumberPrefix(t);
        if ((ntt != null && (ntt instanceof com.pullenti.ner.NumberToken) && prev != null) && ((com.pullenti.ner.NumberToken)com.pullenti.unisharp.Utils.cast(ntt, com.pullenti.ner.NumberToken.class)).getIntValue() != null) 
            return _new308(t, ntt, StreetItemType.NUMBER, ((com.pullenti.ner.NumberToken)com.pullenti.unisharp.Utils.cast(ntt, com.pullenti.ner.NumberToken.class)).getValue(), ((com.pullenti.ner.NumberToken)com.pullenti.unisharp.Utils.cast(ntt, com.pullenti.ner.NumberToken.class)).typ, true);
        StreetItemToken rrr = com.pullenti.ner.geo.internal.OrgItemToken.tryParseRailway(t);
        if (rrr != null) 
            return rrr;
        if ((t instanceof com.pullenti.ner.ReferentToken) && ((com.pullenti.ner.ReferentToken)com.pullenti.unisharp.Utils.cast(t, com.pullenti.ner.ReferentToken.class)).getBeginToken() == ((com.pullenti.ner.ReferentToken)com.pullenti.unisharp.Utils.cast(t, com.pullenti.ner.ReferentToken.class)).getEndToken() && !t.chars.isAllLower()) {
            if (prev != null && prev.typ == StreetItemType.NOUN) {
                if (((short)((prev.getMorph().getNumber().value()) & (com.pullenti.morph.MorphNumber.PLURAL.value()))) == (com.pullenti.morph.MorphNumber.UNDEFINED.value())) {
                    StreetItemToken res = _new285(t, t, StreetItemType.NAME, com.pullenti.ner.core.MiscHelper.getTextValueOfMetaToken((com.pullenti.ner.ReferentToken)com.pullenti.unisharp.Utils.cast(t, com.pullenti.ner.ReferentToken.class), com.pullenti.ner.core.GetTextAttr.NO));
                    if ((t.getNext() != null && t.getNext().isHiphen() && (t.getNext().getNext() instanceof com.pullenti.ner.TextToken)) && !t.isWhitespaceAfter() && !t.getNext().isWhitespaceAfter()) {
                        res.setEndToken(t.getNext().getNext());
                        res.value = (res.value + " " + ((com.pullenti.ner.TextToken)com.pullenti.unisharp.Utils.cast(res.getEndToken(), com.pullenti.ner.TextToken.class)).term);
                    }
                    return res;
                }
            }
        }
        if ((t.isValue("ЧАСТЬ", null) || t.isValue("НАЧАЛО", null) || t.isValue("СЕРЕДИНА", null)) || t.isValue("КОНЕЦ", null)) 
            return null;
        if (t.isValue("УГОЛ", null)) {
            if (prev != null && ((prev.typ == StreetItemType.NOUN || prev.typ == StreetItemType.STDADJECTIVE))) {
            }
            else 
                return null;
        }
        com.pullenti.ner.TextToken tt = (com.pullenti.ner.TextToken)com.pullenti.unisharp.Utils.cast(t, com.pullenti.ner.TextToken.class);
        com.pullenti.ner.core.NounPhraseToken npt = null;
        if (tt != null && tt.getMorph()._getClass().isAdjective()) {
            if (tt.chars.isCapitalUpper() || com.pullenti.ner.geo.internal.MiscLocationHelper.isUserParamAddress(tt) || ((prev != null && prev.typ == StreetItemType.NUMBER && tt.isValue("ТРАНСПОРТНЫЙ", null)))) {
                npt = com.pullenti.ner.geo.internal.MiscLocationHelper.tryParseNpt(tt);
                if (npt != null && (com.pullenti.ner.core.MiscHelper.getTextValueOfMetaToken(npt.noun, com.pullenti.ner.core.GetTextAttr.NO).indexOf("-") >= 0)) 
                    npt = null;
                else if (npt != null && npt.adjectives.size() > 0 && ((npt.adjectives.get(0).isNewlineAfter() || npt.noun.isNewlineBefore()))) 
                    npt = null;
                if (npt != null && AddressItemToken.tryParsePureItem(npt.getEndToken(), null, null) != null) 
                    npt = null;
                com.pullenti.ner.Token tte = tt.getNext();
                if (npt != null && npt.adjectives.size() == 1) 
                    tte = npt.getEndToken();
                if (m_MiscNouns.tryParse(tte, com.pullenti.ner.core.TerminParseAttr.NO) != null) {
                    StreetItemToken sit = _new310(tt, tte, true);
                    sit.typ = StreetItemType.NAME;
                    if (npt == null || npt.adjectives.size() == 0) 
                        sit.value = com.pullenti.ner.core.MiscHelper.getTextValue(tt, tte, com.pullenti.ner.core.GetTextAttr.NO);
                    else if (npt.getMorph().getCase().isGenitive()) {
                        sit.value = com.pullenti.ner.core.MiscHelper.getTextValue(tt, tte, com.pullenti.ner.core.GetTextAttr.NO);
                        sit.altValue = npt.getNormalCaseText(null, com.pullenti.morph.MorphNumber.UNDEFINED, com.pullenti.morph.MorphGender.UNDEFINED, false);
                    }
                    else 
                        sit.value = npt.getNormalCaseText(null, com.pullenti.morph.MorphNumber.UNDEFINED, com.pullenti.morph.MorphGender.UNDEFINED, false);
                    com.pullenti.ner.core.TerminToken tok2 = m_Ontology.tryParse(tt, com.pullenti.ner.core.TerminParseAttr.NO);
                    if (tok2 != null && tok2.termin != null && tok2.getEndToken() == tte) 
                        sit.termin = tok2.termin;
                    return sit;
                }
                if (npt != null && npt.getBeginToken() != npt.getEndToken() && npt.adjectives.size() <= 1) {
                    com.pullenti.ner.core.TerminToken oo = m_Ontology.tryParse(t, com.pullenti.ner.core.TerminParseAttr.NO);
                    if (oo != null) {
                        if (((StreetItemType)oo.termin.tag) == StreetItemType.NOUN || ((StreetItemType)oo.termin.tag) == StreetItemType.STDPARTOFNAME) 
                            npt = null;
                    }
                }
                if (npt != null && npt.getEndToken().isValue("ВЕРХ", null)) 
                    npt = null;
                if (npt != null) {
                    AddressItemToken ait = AddressItemToken.tryParsePureItem(t, null, null);
                    if (ait != null && ait.detailType != com.pullenti.ner.address.AddressDetailType.UNDEFINED) 
                        npt = null;
                }
                if (npt != null && npt.getBeginToken() != npt.getEndToken() && npt.adjectives.size() <= 1) {
                    com.pullenti.ner.Token tt1 = npt.getEndToken().getNext();
                    boolean ok = com.pullenti.ner.geo.internal.MiscLocationHelper.isUserParamAddress(npt);
                    if (npt.isNewlineAfter()) 
                        ok = true;
                    else if (tt1 != null && tt1.isComma()) {
                        ok = true;
                        tt1 = tt1.getNext();
                    }
                    StreetItemToken sti1 = tryParse(tt1, null, false, null);
                    if (sti1 != null && sti1.typ == StreetItemType.NOUN) 
                        ok = true;
                    else if (tt1 != null && tt1.isHiphen() && (tt1.getNext() instanceof com.pullenti.ner.NumberToken)) 
                        ok = true;
                    else {
                        AddressItemToken ait = AddressItemToken.tryParsePureItem(tt1, null, null);
                        if (ait != null) {
                            if (ait.getTyp() == AddressItemType.HOUSE) 
                                ok = true;
                            else if (ait.getTyp() == AddressItemType.NUMBER) {
                                AddressItemToken ait2 = AddressItemToken.tryParsePureItem(npt.getEndToken(), null, null);
                                if (ait2 == null) 
                                    ok = true;
                            }
                        }
                    }
                    if (ok) {
                        sti1 = tryParse(npt.getEndToken(), null, false, null);
                        if (sti1 != null && sti1.typ == StreetItemType.NOUN) 
                            ok = sti1.nounIsDoubtCoef >= 2 && com.pullenti.unisharp.Utils.stringsNe(sti1.termin.getCanonicText(), "КВАРТАЛ");
                        else {
                            com.pullenti.ner.core.TerminToken tok2 = m_Ontology.tryParse(npt.getEndToken(), com.pullenti.ner.core.TerminParseAttr.NO);
                            if (tok2 != null) {
                                StreetItemType _typ = (StreetItemType)tok2.termin.tag;
                                if (_typ == StreetItemType.NOUN || _typ == StreetItemType.STDPARTOFNAME || _typ == StreetItemType.STDADJECTIVE) 
                                    ok = false;
                            }
                        }
                    }
                    if (ok) {
                        StreetItemToken sit = new StreetItemToken(tt, npt.getEndToken());
                        sit.typ = StreetItemType.NAME;
                        sit.value = com.pullenti.ner.core.MiscHelper.getTextValue(tt, npt.getEndToken(), com.pullenti.ner.core.GetTextAttr.NO);
                        sit.altValue = npt.getNormalCaseText(null, com.pullenti.morph.MorphNumber.UNDEFINED, com.pullenti.morph.MorphGender.UNDEFINED, false);
                        if (sit.altValue.endsWith("ПОЛОК")) 
                            sit.altValue = sit.altValue.substring(0, 0 + sit.altValue.length() - 5) + "ПОЛК";
                        return sit;
                    }
                }
            }
        }
        if (tt != null && (tt.getNext() instanceof com.pullenti.ner.TextToken) && ((!tt.getNext().chars.isAllLower() || com.pullenti.ner.geo.internal.MiscLocationHelper.isUserParamAddress(tt)))) {
            if (m_MiscNouns.tryParse(tt, com.pullenti.ner.core.TerminParseAttr.NO) != null) {
                StreetItemToken sit = tryParse(tt.getNext(), null, false, null);
                if (sit != null && sit.typ == StreetItemType.NAME) {
                    if (sit.value != null) 
                        sit.value = (sit.value + " " + tt.getNormalCaseText(null, com.pullenti.morph.MorphNumber.UNDEFINED, com.pullenti.morph.MorphGender.UNDEFINED, false));
                    else 
                        sit.value = (sit.getSourceText().toUpperCase() + " " + tt.getNormalCaseText(null, com.pullenti.morph.MorphNumber.UNDEFINED, com.pullenti.morph.MorphGender.UNDEFINED, false));
                    if (sit.altValue != null) 
                        sit.altValue = (sit.altValue + " " + tt.getNormalCaseText(null, com.pullenti.morph.MorphNumber.UNDEFINED, com.pullenti.morph.MorphGender.UNDEFINED, false));
                    sit.setBeginToken(tt);
                    sit.hasStdSuffix = true;
                    return sit;
                }
            }
        }
        if (((tt != null && tt.getLengthChar() == 1 && tt.chars.isAllLower()) && tt.getNext() != null && tt.getNext().isChar('.')) && tt.kit.baseLanguage.isRu()) {
            if (tt.isValue("М", null) || tt.isValue("M", null)) {
                if (prev != null && prev.typ == StreetItemType.NOUN) {
                }
                else if (!inSearch) {
                    com.pullenti.ner.core.TerminToken tok1 = m_Ontology.tryParse(tt, com.pullenti.ner.core.TerminParseAttr.NO);
                    if (tok1 != null && com.pullenti.unisharp.Utils.stringsEq(tok1.termin.getCanonicText(), "МИКРОРАЙОН")) 
                        return _new311(tt, tok1.getEndToken(), tok1.termin, StreetItemType.NOUN);
                    if (com.pullenti.ner.geo.internal.NameToken.checkInitial(tt) != null || com.pullenti.ner.geo.internal.MiscLocationHelper.isUserParamAddress(tt)) {
                    }
                    else 
                        return _new312(tt, tt.getNext(), m_Metro, StreetItemType.NOUN, true);
                }
            }
        }
        com.pullenti.ner.core.IntOntologyToken ot = null;
        if (!com.pullenti.ner.geo.internal.MiscLocationHelper.isUserParamAddress(t)) {
            if (t.kit.ontology != null && ot == null) {
                java.util.ArrayList<com.pullenti.ner.core.IntOntologyToken> ots = t.kit.ontology.attachToken(com.pullenti.ner.address.AddressReferent.OBJ_TYPENAME, t);
                if (ots != null) 
                    ot = ots.get(0);
            }
            if (ot != null && ot.getBeginToken() == ot.getEndToken() && ot.getMorph()._getClass().isAdjective()) {
                com.pullenti.ner.core.TerminToken tok0 = m_Ontology.tryParse(t, com.pullenti.ner.core.TerminParseAttr.NO);
                if (tok0 != null) {
                    if (((StreetItemType)tok0.termin.tag) == StreetItemType.STDADJECTIVE) 
                        ot = null;
                }
            }
        }
        if (ot != null) {
            StreetItemToken res0 = _new313(ot.getBeginToken(), ot.getEndToken(), StreetItemType.NAME, (com.pullenti.ner.address.StreetReferent)com.pullenti.unisharp.Utils.cast(ot.item.referent, com.pullenti.ner.address.StreetReferent.class), ot.getMorph(), true);
            return res0;
        }
        if (prev != null && prev.typ == StreetItemType.NOUN && com.pullenti.unisharp.Utils.stringsEq(prev.termin.getCanonicText(), "ПРОЕЗД")) {
            if (t.isValue("ПР", null)) {
                StreetItemToken res1 = _new285(t, t, StreetItemType.NAME, "ПРОЕКТИРУЕМЫЙ");
                if (t.getNext() != null && t.getNext().isChar('.')) 
                    res1.setEndToken(t.getNext());
                return res1;
            }
        }
        com.pullenti.ner.core.TerminToken tok = (ignoreOnto ? null : m_Ontology.tryParse(t, com.pullenti.ner.core.TerminParseAttr.NO));
        com.pullenti.ner.core.TerminToken tokEx = (ignoreOnto ? null : m_OntologyEx.tryParse(t, com.pullenti.ner.core.TerminParseAttr.NO));
        if (tok == null) 
            tok = tokEx;
        else if (tokEx != null && tokEx.getEndChar() > tok.getEndChar()) 
            tok = tokEx;
        if (tok != null && (t instanceof com.pullenti.ner.TextToken) && ((com.pullenti.unisharp.Utils.stringsEq(((com.pullenti.ner.TextToken)com.pullenti.unisharp.Utils.cast(t, com.pullenti.ner.TextToken.class)).term, "ДОРОГАЯ") || com.pullenti.unisharp.Utils.stringsEq(((com.pullenti.ner.TextToken)com.pullenti.unisharp.Utils.cast(t, com.pullenti.ner.TextToken.class)).term, "ДОРОГОЙ")))) 
            tok = null;
        if ((tok != null && t.getLengthChar() == 1 && t.isValue("Б", null)) && (t.getPrevious() instanceof com.pullenti.ner.NumberToken) && com.pullenti.unisharp.Utils.stringsEq(((com.pullenti.ner.NumberToken)com.pullenti.unisharp.Utils.cast(t.getPrevious(), com.pullenti.ner.NumberToken.class)).getValue(), "26")) 
            tok = null;
        if ((tok != null && com.pullenti.unisharp.Utils.stringsEq(tok.termin.getCanonicText(), "БЛОК") && (t instanceof com.pullenti.ner.TextToken)) && tok.getEndToken() == t) {
            if (com.pullenti.unisharp.Utils.stringsEq(((com.pullenti.ner.TextToken)com.pullenti.unisharp.Utils.cast(t, com.pullenti.ner.TextToken.class)).term, "БЛОКА")) 
                tok = null;
            else if (t.chars.isAllLower()) {
            }
            else if (prev != null && prev.typ == StreetItemType.NOUN && com.pullenti.unisharp.Utils.stringsEq(prev.termin.getCanonicText(), "РЯД")) {
            }
            else {
                AddressItemToken ait = AddressItemToken.tryParsePureItem(t.getNext(), null, null);
                if (ait != null && ait.getTyp() == AddressItemType.NUMBER) {
                }
                else 
                    tok = null;
            }
        }
        if (tok != null && com.pullenti.unisharp.Utils.stringsEq(tok.termin.getCanonicText(), "СЕКЦИЯ")) {
            if (prev != null) 
                tok = null;
        }
        if (tok != null && tok.getBeginToken() == tok.getEndToken()) {
            if ((((StreetItemType)tok.termin.tag) == StreetItemType.NAME || t.isValue("ГАРАЖНО", null) || t.getLengthChar() == 1) || t.isValue("СТ", null)) {
                com.pullenti.ner.geo.internal.OrgItemToken __org = com.pullenti.ner.geo.internal.OrgItemToken.tryParse(t, null);
                if (__org != null) {
                    tok = null;
                    if (t.getLengthChar() < 3) 
                        return _new86(t, __org.getEndToken(), StreetItemType.FIX, __org);
                }
            }
            else if (((StreetItemType)tok.termin.tag) == StreetItemType.STDADJECTIVE && (t instanceof com.pullenti.ner.TextToken) && ((com.pullenti.ner.TextToken)com.pullenti.unisharp.Utils.cast(t, com.pullenti.ner.TextToken.class)).term.endsWith("О")) 
                tok = null;
            else if (t.isValue("АК", null) && t.getNext() != null && t.getNext().isHiphen()) 
                tok = null;
            else if (((StreetItemType)tok.termin.tag) == StreetItemType.NOUN && t.isValue("САД", null) && t.getPrevious() != null) {
                if (t.getPrevious().isValue("ДЕТСКИЙ", null)) 
                    tok = null;
                else if (t.getPrevious().isHiphen() && t.getPrevious().getPrevious() != null && t.getPrevious().getPrevious().isValue("ЯСЛИ", null)) 
                    tok = null;
            }
        }
        if (tok != null && !ignoreOnto) {
            if (((StreetItemType)tok.termin.tag) == StreetItemType.NUMBER) {
                if ((tok.getEndToken().getNext() instanceof com.pullenti.ner.NumberToken) && ((com.pullenti.ner.NumberToken)com.pullenti.unisharp.Utils.cast(tok.getEndToken().getNext(), com.pullenti.ner.NumberToken.class)).getIntValue() != null) 
                    return _new316(t, tok.getEndToken().getNext(), StreetItemType.NUMBER, ((com.pullenti.ner.NumberToken)com.pullenti.unisharp.Utils.cast(tok.getEndToken().getNext(), com.pullenti.ner.NumberToken.class)).getValue(), ((com.pullenti.ner.NumberToken)com.pullenti.unisharp.Utils.cast(tok.getEndToken().getNext(), com.pullenti.ner.NumberToken.class)).typ, true, tok.getMorph());
                return null;
            }
            if (((StreetItemType)tok.termin.tag) == StreetItemType.ABSENT) 
                return _new305(t, tok.getEndToken(), StreetItemType.ABSENT);
            if (tt == null) 
                return null;
            boolean abr = true;
            switch (((StreetItemType)tok.termin.tag).value()) { 
            case 3: // StreetItemType.STDADJECTIVE 
                com.pullenti.ner.Token tt3 = com.pullenti.ner.geo.internal.NameToken.checkInitial(tok.getBeginToken());
                if (tt3 != null) {
                    StreetItemToken _next = tryParse(tt3, prev, inSearch, null);
                    if (_next != null && _next.typ != StreetItemType.NOUN) {
                        if (_next.value == null) 
                            _next.value = com.pullenti.ner.core.MiscHelper.getTextValueOfMetaToken(_next, com.pullenti.ner.core.GetTextAttr.NO);
                        _next.setBeginToken(t0);
                        return _next;
                    }
                }
                if (tt.chars.isAllLower() && prev == null && !inSearch) {
                    if (!com.pullenti.ner.geo.internal.MiscLocationHelper.isUserParamAddress(tok)) 
                        return null;
                }
                if (tt.isValue(tok.termin.getCanonicText(), null)) 
                    abr = false;
                else if (tt.getLengthChar() == 1) {
                    if (!tt.isWhitespaceBefore() && !tt.getPrevious().isCharOf(":,.")) 
                        break;
                    if (!tok.getEndToken().isChar('.')) {
                        boolean oo2 = false;
                        if (!tt.chars.isAllUpper() && !inSearch) {
                            if ((tt.isCharOf("мб") && (tt.getPrevious() instanceof com.pullenti.ner.TextToken) && tt.getPrevious().chars.isCapitalUpper()) && AddressItemToken.checkHouseAfter(tt.getNext(), false, false)) 
                                oo2 = true;
                            else 
                                break;
                        }
                        if (tok.getEndToken().isNewlineAfter() && prev != null && prev.typ != StreetItemType.NOUN) 
                            oo2 = true;
                        else if (inSearch) 
                            oo2 = true;
                        else {
                            StreetItemToken _next = tryParse(tok.getEndToken().getNext(), null, false, null);
                            if (_next != null && ((_next.typ == StreetItemType.NAME || _next.typ == StreetItemType.NOUN))) 
                                oo2 = true;
                            else if (AddressItemToken.checkHouseAfter(tok.getEndToken().getNext(), false, true) && prev != null) 
                                oo2 = true;
                        }
                        if (oo2) 
                            return _new318(tok.getBeginToken(), tok.getEndToken(), StreetItemType.STDADJECTIVE, tok.termin, abr, tok.getMorph());
                        break;
                    }
                    com.pullenti.ner.Token tt2 = tok.getEndToken().getNext();
                    if (tt2 != null && tt2.isHiphen()) 
                        tt2 = tt2.getNext();
                    if (tt2 instanceof com.pullenti.ner.TextToken) {
                        if (tt2.getLengthChar() == 1 && tt2.chars.isAllUpper()) 
                            break;
                        if (tt2.chars.isCapitalUpper()) {
                            boolean isSur = false;
                            String txt = ((com.pullenti.ner.TextToken)com.pullenti.unisharp.Utils.cast(tt2, com.pullenti.ner.TextToken.class)).term;
                            if (com.pullenti.morph.LanguageHelper.endsWith(txt, "ОГО")) 
                                isSur = true;
                            else 
                                for (com.pullenti.morph.MorphBaseInfo wf : tt2.getMorph().getItems()) {
                                    if (wf._getClass().isProperSurname() && ((com.pullenti.morph.MorphWordForm)com.pullenti.unisharp.Utils.cast(wf, com.pullenti.morph.MorphWordForm.class)).isInDictionary()) {
                                        if (wf.getCase().isGenitive()) {
                                            isSur = true;
                                            break;
                                        }
                                    }
                                }
                            if (isSur) 
                                break;
                        }
                    }
                }
                StreetItemToken res1 = _new318(tok.getBeginToken(), tok.getEndToken(), StreetItemType.STDADJECTIVE, tok.termin, abr, tok.getMorph());
                java.util.ArrayList<com.pullenti.ner.core.TerminToken> toks = m_Ontology.tryParseAll(tok.getBeginToken(), com.pullenti.ner.core.TerminParseAttr.NO);
                if (toks != null && toks.size() > 1) 
                    res1.altTermin = toks.get(1).termin;
                return res1;
            case 0: // StreetItemType.NOUN 
                if ((tt.isValue(tok.termin.getCanonicText(), null) || tok.getEndToken().isValue(tok.termin.getCanonicText(), null) || tt.isValue("УЛ", null)) || com.pullenti.unisharp.Utils.stringsEq(tok.termin.getCanonicText(), "НАБЕРЕЖНАЯ")) 
                    abr = false;
                else if (tok.getBeginToken() != tok.getEndToken() && ((tok.getBeginToken().getNext().isHiphen() || tok.getBeginToken().getNext().isCharOf("/\\")))) {
                }
                else if (!tt.chars.isAllLower() && tt.getLengthChar() == 1 && !tt.isValue("Ш", null)) 
                    break;
                else if (tt.getLengthChar() == 1) {
                    if (!tt.isWhitespaceBefore()) {
                        if (tt.getPrevious() != null && tt.getPrevious().isCharOf(",")) {
                        }
                        else 
                            return null;
                    }
                    if (com.pullenti.ner.geo.internal.NameToken.checkInitial(tt) != null) 
                        break;
                    if (tok.getEndToken().isChar('.')) {
                    }
                    else if (tok.getBeginToken() != tok.getEndToken() && tok.getBeginToken().getNext() != null && ((tok.getBeginToken().getNext().isHiphen() || tok.getBeginToken().getNext().isCharOf("/\\")))) {
                    }
                    else if (tok.getLengthChar() > 5) {
                    }
                    else if (tok.getBeginToken() == tok.getEndToken() && tt.isValue("Ш", null) && ((tt.chars.isAllLower() || com.pullenti.ner.geo.internal.MiscLocationHelper.isUserParamAddress(tt)))) {
                        if (prev != null && ((prev.typ == StreetItemType.NAME || prev.typ == StreetItemType.STDNAME || prev.typ == StreetItemType.STDPARTOFNAME))) {
                        }
                        else {
                            StreetItemToken sii = tryParse(tt.getNext(), null, false, null);
                            if (sii != null && (((sii.typ == StreetItemType.NAME || sii.typ == StreetItemType.STDNAME || sii.typ == StreetItemType.STDPARTOFNAME) || sii.typ == StreetItemType.AGE))) {
                            }
                            else 
                                return null;
                        }
                    }
                    else 
                        return null;
                }
                else if (com.pullenti.unisharp.Utils.stringsEq(tt.term, "КВ") && !tok.getEndToken().isValue("Л", null)) {
                    if (prev != null && prev.typ == StreetItemType.NUMBER) 
                        return null;
                    AddressItemToken ait = AddressItemToken.tryParsePureItem(tok.getEndToken().getNext(), null, null);
                    if (ait != null && ait.getTyp() == AddressItemType.NUMBER) {
                        if (AddressItemToken.checkHouseAfter(ait.getEndToken().getNext(), false, false)) {
                        }
                        else if (AddressItemToken.checkStreetAfter(ait.getEndToken().getNext(), false)) {
                        }
                        else 
                            return null;
                    }
                    else if (tok.getEndToken().getNext() != null && tok.getEndToken().getNext().isValue("НЕТ", null)) 
                        return null;
                }
                if ((tok.getEndToken() == tok.getBeginToken() && !t.chars.isAllLower() && t.getMorph()._getClass().isProperSurname()) && t.chars.isCyrillicLetter()) {
                    if (((short)((t.getMorph().getNumber().value()) & (com.pullenti.morph.MorphNumber.PLURAL.value()))) != (com.pullenti.morph.MorphNumber.UNDEFINED.value()) && !com.pullenti.ner.geo.internal.MiscLocationHelper.isUserParamAddress(t)) {
                        if (!t.isValue("НАБЕРЕЖНЫЙ", null)) 
                            return null;
                    }
                }
                if (com.pullenti.unisharp.Utils.stringsEq(tt.term, "ДОРОГОЙ") || com.pullenti.unisharp.Utils.stringsEq(tt.term, "РЯДОМ")) 
                    return null;
                if (tt.isValue("ЗАЕЗД", null) || tt.isValue("ВЫЕЗД", null)) {
                    if (!com.pullenti.ner.geo.internal.MiscLocationHelper.isUserParamAddress(tt)) 
                        return null;
                }
                if (tt.isValue("НАБЕРЕЖНЫЙ", null) && (tt instanceof com.pullenti.ner.TextToken)) {
                    boolean isName = false;
                    StreetItemToken _next = _tryParse(tt.getNext(), ignoreOnto, null, inSearch);
                    if (prev != null) {
                        if (_next != null && _next.typ == StreetItemType.NAME) {
                        }
                        else if (prev.typ == StreetItemType.NOUN || prev.typ == StreetItemType.NUMBER) 
                            isName = true;
                    }
                    else if (_next == null) 
                        isName = true;
                    else if (_next.typ == StreetItemType.NOUN || _next.typ == StreetItemType.NUMBER) 
                        isName = true;
                    if (isName) 
                        return _new285(tt, tt, StreetItemType.NAME, ((com.pullenti.ner.TextToken)com.pullenti.unisharp.Utils.cast(tt, com.pullenti.ner.TextToken.class)).term);
                }
                com.pullenti.ner.core.Termin alt = null;
                if (tok.getBeginToken().isValue("ПР", null) && ((tok.getBeginToken() == tok.getEndToken() || tok.getBeginToken().getNext().isChar('.')))) 
                    alt = m_Prospect;
                StreetItemToken res = _new321(tok.getBeginToken(), tok.getEndToken(), StreetItemType.NOUN, tok.termin, alt, abr, tok.getMorph(), (tok.termin.tag2 instanceof Integer ? (int)tok.termin.tag2 : 0));
                com.pullenti.morph.MorphClass mc = tok.getBeginToken().getMorphClassInDictionary();
                if ((!abr && tok.getBeginToken() == tok.getEndToken() && !tok.getBeginToken().chars.isAllLower()) && ((mc.isNoun() || mc.isAdjective()))) {
                    if (tok.getMorph().getCase().isNominative() && !tok.getMorph().getCase().isGenitive()) 
                        res.nounCanBeName = true;
                    else if ((t.getNext() != null && t.getNext().isHiphen() && (t.getNext().getNext() instanceof com.pullenti.ner.NumberToken)) && !t.chars.isAllLower()) 
                        res.nounCanBeName = true;
                }
                if (res.isRoad()) {
                    StreetItemToken _next = _tryParse(res.getEndToken().getNext(), false, null, false);
                    if (_next != null && _next.isRoad()) {
                        res.setEndToken(_next.getEndToken());
                        res.nounIsDoubtCoef = 0;
                        res.isAbridge = false;
                    }
                }
                if (!res.isWhitespaceAfter() && res.getEndToken().getNext().isChar('(')) {
                    com.pullenti.ner.core.BracketSequenceToken br = com.pullenti.ner.core.BracketHelper.tryParse(res.getEndToken().getNext(), com.pullenti.ner.core.BracketParseAttr.NO, 100);
                    if (br != null && (br.getLengthChar() < 5) && (br.getBeginToken().getNext() instanceof com.pullenti.ner.TextToken)) 
                        res.setEndToken(br.getEndToken());
                }
                return res;
            case 4: // StreetItemType.STDNAME 
                boolean isPostOff = com.pullenti.unisharp.Utils.stringsEq(tok.termin.getCanonicText(), "ПОЧТОВОЕ ОТДЕЛЕНИЕ") || com.pullenti.unisharp.Utils.stringsEq(tok.termin.getCanonicText(), "ПРОЕКТИРУЕМЫЙ");
                if (((t.getLengthChar() == 1 && t.getNext() != null && t.getNext().isChar('.')) && t.getNext().getNext() != null && t.getNext().getNext().getLengthChar() == 1) && t.getNext().getNext().getEndChar() <= tok.getEndChar()) {
                    StreetItemToken _next = _tryParse(tok.getEndToken().getNext(), ignoreOnto, prev, inSearch);
                    if (_next != null && ((_next.typ == StreetItemType.NAME || _next.typ == StreetItemType.STDNAME))) {
                        _next.value = com.pullenti.ner.core.MiscHelper.getTextValueOfMetaToken(_next, com.pullenti.ner.core.GetTextAttr.NO);
                        _next.setBeginToken(t);
                        return _next;
                    }
                }
                if (tok.getBeginToken().chars.isAllLower() && !isPostOff && tok.getEndToken().chars.isAllLower()) {
                    if (checkKeyword(tok.getEndToken().getNext())) {
                    }
                    else if (prev != null && ((prev.typ == StreetItemType.NUMBER || prev.typ == StreetItemType.NOUN || prev.typ == StreetItemType.AGE))) {
                    }
                    else if (com.pullenti.ner.geo.internal.MiscLocationHelper.isUserParamAddress(tok)) {
                    }
                    else 
                        return null;
                }
                StreetItemToken sits = _new322(tok.getBeginToken(), tok.getEndToken(), StreetItemType.STDNAME, tok.getMorph(), tok.termin.getCanonicText());
                if (tok.termin.additionalVars != null && tok.termin.additionalVars.size() > 0 && !tok.termin.additionalVars.get(0).getCanonicText().startsWith("ПАРТ")) {
                    if (tok.termin.additionalVars.get(0).getCanonicText().indexOf(' ') < 0) {
                        sits.altValue = sits.value;
                        sits.value = tok.termin.additionalVars.get(0).getCanonicText();
                    }
                    else 
                        sits.altValue = tok.termin.additionalVars.get(0).getCanonicText();
                    int ii = sits.altValue.indexOf(sits.value);
                    if (ii >= 0) {
                        if (ii > 0) 
                            sits.misc = sits.altValue.substring(0, 0 + ii).trim();
                        else 
                            sits.misc = sits.altValue.substring(sits.value.length()).trim();
                        sits.altValue = null;
                    }
                }
                if (tok.getBeginToken() != tok.getEndToken() && !isPostOff) {
                    if (tok.getBeginToken().getNext() == tok.getEndToken()) {
                        if (tok.getEndToken().getMorphClassInDictionary().isNoun() && tok.getBeginToken().getMorphClassInDictionary().isAdjective()) {
                        }
                        else if (((m_StdOntMisc.tryParse(tok.getBeginToken(), com.pullenti.ner.core.TerminParseAttr.NO) != null || tok.getBeginToken().getMorphClassInDictionary().isProperName() || (tok.getBeginToken().getLengthChar() < 4))) && tok.getEndToken().getLengthChar() > 2 && ((tok.getEndToken().getMorph()._getClass().isProperSurname() || !tok.getEndToken().getMorphClassInDictionary().isProperName()))) 
                            sits.altValue2 = com.pullenti.ner.core.MiscHelper.getTextValue(tok.getEndToken(), tok.getEndToken(), com.pullenti.ner.core.GetTextAttr.NO);
                        else if (((tok.getEndToken().getMorphClassInDictionary().isProperName() || m_StdOntMisc.tryParse(tok.getEndToken(), com.pullenti.ner.core.TerminParseAttr.NO) != null)) && (tok.getBeginToken().getMorph()._getClass().isProperSurname())) 
                            sits.altValue2 = com.pullenti.ner.core.MiscHelper.getTextValue(tok.getBeginToken(), tok.getBeginToken(), com.pullenti.ner.core.GetTextAttr.NO);
                    }
                }
                if ((sits.getEndToken().getNext() instanceof com.pullenti.ner.TextToken) && sits.getEndToken().getNext().getLengthChar() == 1) {
                    if (com.pullenti.ner.geo.internal.NameToken.checkInitialAndSurname(((com.pullenti.ner.TextToken)com.pullenti.unisharp.Utils.cast(sits.getEndToken().getNext(), com.pullenti.ner.TextToken.class)).term, sits.getBeginToken())) {
                        sits.setEndToken(sits.getEndToken().getNext());
                        if (sits.getEndToken().getNext() != null && sits.getEndToken().getNext().isChar('.')) 
                            sits.setEndToken(sits.getEndToken().getNext());
                    }
                }
                return sits;
            case 5: // StreetItemType.STDPARTOFNAME 
                com.pullenti.ner.Token tt1 = tok.getEndToken();
                String vvv = tok.termin.getCanonicText();
                if ((tt1.getNext() instanceof com.pullenti.ner.NumberToken) && tt1.getNext().getNext() != null && tt1.getNext().getNext().isValue("РАНГ", null)) 
                    tt1 = tt1.getNext().getNext();
                com.pullenti.ner.core.TerminToken tok2 = m_Ontology.tryParse(tt1.getNext(), com.pullenti.ner.core.TerminParseAttr.NO);
                if (tok2 != null && ((StreetItemType)tok2.termin.tag) == StreetItemType.STDPARTOFNAME) {
                    tt1 = tok2.getEndToken();
                    vvv = (vvv + " " + tok2.termin.getCanonicText());
                }
                boolean noGeo = false;
                if (tt1.getNext() != null) {
                    if ((tt1.getNext().isValue("ПОЛИЦИИ", null) || tt1.getNext().isValue("МИЛИЦИИ", null) || tt1.getNext().isValue("ГВАРДИИ", null)) || tt1.getNext().isValue("АРМИИ", null)) 
                        tt1 = tt1.getNext();
                    if (tt1.getNext() != null && (tt1.getNext().getReferent() instanceof com.pullenti.ner.geo.GeoReferent)) 
                        tt1 = tt1.getNext();
                    else {
                        com.pullenti.ner.geo.internal.TerrItemToken ter = com.pullenti.ner.geo.internal.TerrItemToken.tryParse(tt1.getNext(), null, null);
                        if (ter != null && ter.ontoItem != null) {
                            tt1 = ter.getEndToken();
                            noGeo = true;
                        }
                    }
                }
                StreetItemToken sit = tryParse(tt1.getNext(), null, false, null);
                if ((sit == null && tt1.getNext() != null && vvv != null) && tt1.getNext().isHiphen()) 
                    sit = tryParse(tt1.getNext().getNext(), null, false, null);
                if (sit != null && sit.typ == StreetItemType.STDADJECTIVE && tt1.getNext().getLengthChar() == 1) 
                    sit = tryParse(sit.getEndToken().getNext(), null, false, null);
                if (sit == null || tt1.getWhitespacesAfterCount() > 3) {
                    for (com.pullenti.morph.MorphBaseInfo m : tok.getMorph().getItems()) {
                        if (m.getNumber() == com.pullenti.morph.MorphNumber.PLURAL && m.getCase().isGenitive()) 
                            return _new322(tok.getBeginToken(), tt1, StreetItemType.NAME, tok.getMorph(), com.pullenti.ner.core.MiscHelper.getTextValueOfMetaToken(tok, com.pullenti.ner.core.GetTextAttr.NO));
                    }
                    return _new324(tok.getBeginToken(), tt1, StreetItemType.STDPARTOFNAME, tok.getMorph(), tok.termin);
                }
                if (sit.typ == StreetItemType.NUMBER || sit.typ == StreetItemType.STDADJECTIVE) 
                    return _new322(tok.getBeginToken(), tt1, StreetItemType.NAME, tok.getMorph(), com.pullenti.ner.core.MiscHelper.getTextValueOfMetaToken(tok, com.pullenti.ner.core.GetTextAttr.NO));
                if (sit.typ != StreetItemType.NAME && sit.typ != StreetItemType.NOUN && sit.typ != StreetItemType.STDNAME) 
                    return null;
                if (sit.typ == StreetItemType.NOUN) {
                    if (((short)((tok.getMorph().getNumber().value()) & (com.pullenti.morph.MorphNumber.PLURAL.value()))) == (com.pullenti.morph.MorphNumber.PLURAL.value())) 
                        return _new326(tok.getBeginToken(), tt1, StreetItemType.NAME, StreetItemType.STDPARTOFNAME, tok.getMorph(), com.pullenti.ner.core.MiscHelper.getTextValueOfMetaToken(tok, com.pullenti.ner.core.GetTextAttr.NO));
                    else 
                        return _new327(tok.getBeginToken(), tt1, StreetItemType.NAME, StreetItemType.STDPARTOFNAME, tok.getMorph(), tok.termin);
                }
                if (sit.value != null) 
                    sit.misc = vvv;
                else if (sit.existStreet == null) {
                    if (com.pullenti.unisharp.Utils.stringsEq(vvv, "ГЕРОЯ")) {
                        if (com.pullenti.unisharp.Utils.stringsNe(((com.pullenti.ner.TextToken)com.pullenti.unisharp.Utils.cast(tt1, com.pullenti.ner.TextToken.class)).term, "ГЕРОЕВ") && sit.getBeginToken().getMorph()._getClass().isProperSurname()) 
                            sit.value = com.pullenti.ner.core.MiscHelper.getTextValueOfMetaToken(sit, com.pullenti.ner.core.GetTextAttr.NO);
                        else 
                            sit.value = "ГЕРОЕВ " + com.pullenti.ner.core.MiscHelper.getTextValueOfMetaToken(sit, com.pullenti.ner.core.GetTextAttr.NO);
                        sit.noGeoInThisToken = true;
                    }
                    else {
                        sit.misc = vvv;
                        sit.value = com.pullenti.ner.core.MiscHelper.getTextValueOfMetaToken(sit, com.pullenti.ner.core.GetTextAttr.NO);
                    }
                }
                sit.setBeginToken(tok.getBeginToken());
                if (noGeo) 
                    sit.noGeoInThisToken = true;
                return sit;
            case 1: // StreetItemType.NAME 
                if (tok.getBeginToken().chars.isAllLower()) {
                    if (prev != null && prev.typ == StreetItemType.STDADJECTIVE) {
                    }
                    else if (prev != null && prev.typ == StreetItemType.NOUN && AddressItemToken.checkHouseAfter(tok.getEndToken().getNext(), true, false)) {
                    }
                    else if (t.isValue("ПРОЕКТИРУЕМЫЙ", null) || t.isValue("МИРА", null)) {
                    }
                    else {
                        StreetItemToken nex = tryParse(tok.getEndToken().getNext(), null, false, null);
                        if (nex != null && nex.typ == StreetItemType.NOUN) {
                            com.pullenti.ner.Token tt2 = nex.getEndToken().getNext();
                            while (tt2 != null && tt2.isCharOf(",.")) {
                                tt2 = tt2.getNext();
                            }
                            if (tt2 == null || tt2.getWhitespacesBeforeCount() > 1) 
                                return null;
                            if (AddressItemToken.checkHouseAfter(tt2, false, true)) {
                            }
                            else 
                                return null;
                        }
                        else 
                            return null;
                    }
                }
                StreetItemToken sit0 = tryParse(tok.getBeginToken(), prev, true, null);
                if (sit0 != null && sit0.typ == StreetItemType.NAME && sit0.getEndChar() > tok.getEndChar()) {
                    sit0.isInDictionary = true;
                    return sit0;
                }
                StreetItemToken sit1 = _new328(tok.getBeginToken(), tok.getEndToken(), StreetItemType.NAME, tok.getMorph(), true);
                if ((!tok.isWhitespaceAfter() && tok.getEndToken().getNext() != null && tok.getEndToken().getNext().isHiphen()) && !tok.getEndToken().getNext().isWhitespaceAfter()) {
                    StreetItemToken sit2 = tryParse(tok.getEndToken().getNext().getNext(), null, false, null);
                    if (sit2 != null && ((sit2.typ == StreetItemType.NAME || sit2.typ == StreetItemType.STDPARTOFNAME || sit2.typ == StreetItemType.STDNAME))) 
                        sit1.setEndToken(sit2.getEndToken());
                }
                if (npt != null && (sit1.getEndChar() < npt.getEndChar()) && m_Ontology.tryParse(npt.getEndToken(), com.pullenti.ner.core.TerminParseAttr.NO) == null) {
                    StreetItemToken sit2 = _tryParse(t, true, prev, inSearch);
                    if (sit2 != null && sit2.getEndChar() > sit1.getEndChar()) 
                        return sit2;
                }
                return sit1;
            case 7: // StreetItemType.FIX 
                return _new329(tok.getBeginToken(), tok.getEndToken(), StreetItemType.FIX, tok.getMorph(), true, tok.termin);
        }
        }
        if (tt != null && ((tt.isValue("КИЛОМЕТР", null) || tt.isValue("КМ", null)))) {
            com.pullenti.ner.Token tt1 = tt;
            if (tt1.getNext() != null && tt1.getNext().isChar('.')) 
                tt1 = tt1.getNext();
            if ((tt1.getWhitespacesAfterCount() < 3) && (tt1.getNext() instanceof com.pullenti.ner.NumberToken)) {
                StreetItemToken sit = _new305(tt, tt1.getNext(), StreetItemType.NUMBER);
                sit.value = ((com.pullenti.ner.NumberToken)com.pullenti.unisharp.Utils.cast(tt1.getNext(), com.pullenti.ner.NumberToken.class)).getValue();
                sit.numberType = ((com.pullenti.ner.NumberToken)com.pullenti.unisharp.Utils.cast(tt1.getNext(), com.pullenti.ner.NumberToken.class)).typ;
                sit.isNumberKm = true;
                boolean isPlus = false;
                com.pullenti.ner.Token tt2 = sit.getEndToken().getNext();
                if (tt2 != null && ((tt2.isHiphen() || tt2.isChar('+')))) {
                    isPlus = tt2.isChar('+');
                    tt2 = tt2.getNext();
                }
                com.pullenti.ner.core.NumberExToken nex2 = com.pullenti.ner.core.NumberHelper.tryParseNumberWithPostfix(tt2);
                if (nex2 != null && nex2.exTyp == com.pullenti.ner.core.NumberExType.METER) {
                    sit.setEndToken(nex2.getEndToken());
                    String mm = com.pullenti.ner.core.NumberHelper.doubleToString(nex2.getRealValue() / (1000.0));
                    if (mm.startsWith("0.")) 
                        sit.value += mm.substring(1);
                }
                else if ((tt2 instanceof com.pullenti.ner.NumberToken) && isPlus) {
                    double dw = ((com.pullenti.ner.NumberToken)com.pullenti.unisharp.Utils.cast(tt2, com.pullenti.ner.NumberToken.class)).getRealValue();
                    if (dw > 0 && (dw < 1000)) {
                        sit.setEndToken(tt2);
                        String mm = com.pullenti.ner.core.NumberHelper.doubleToString(dw / (1000.0));
                        if (mm.startsWith("0.")) 
                            sit.value += mm.substring(1);
                    }
                }
                return sit;
            }
            StreetItemToken _next = tryParse(tt.getNext(), null, inSearch, null);
            if (_next != null && ((_next.isRailway || _next.isRoad()))) {
                _next.setBeginToken(tt);
                return _next;
            }
        }
        com.pullenti.ner.core.TerminToken tokn = com.pullenti.ner.geo.internal.NameToken.M_ONTO.tryParse(tt, com.pullenti.ner.core.TerminParseAttr.NO);
        if (tokn != null) 
            return _new285(tt, tokn.getEndToken(), StreetItemType.NAME, tokn.termin.getCanonicText());
        if (tt != null) {
            if (((tt.isValue("РЕКА", null) || tt.isValue("РЕЧКА", "РІЧКА"))) && tt.getNext() != null && ((!tt.getNext().chars.isAllLower() || com.pullenti.ner.geo.internal.MiscLocationHelper.isUserParamAddress(tt)))) {
                com.pullenti.ner.geo.internal.NameToken nam = com.pullenti.ner.geo.internal.NameToken.tryParse(tt.getNext(), com.pullenti.ner.geo.internal.GeoTokenType.CITY, 0, false);
                if (nam != null && nam.name != null && nam.number == null) 
                    return _new332(tt, nam.getEndToken(), StreetItemType.NAME, tt.getMorph(), "реки", nam.name);
            }
            if ((tt.isValue("Р", null) && prev != null && prev.termin != null) && com.pullenti.unisharp.Utils.stringsEq(prev.termin.getCanonicText(), "НАБЕРЕЖНАЯ")) {
                com.pullenti.ner.Token tt2 = tt.getNext();
                if (tt2 != null && tt2.isChar('.')) 
                    tt2 = tt2.getNext();
                com.pullenti.ner.geo.internal.NameToken nam = com.pullenti.ner.geo.internal.NameToken.tryParse(tt2, com.pullenti.ner.geo.internal.GeoTokenType.CITY, 0, false);
                if (nam != null && nam.name != null && nam.number == null) 
                    return _new332(tt, nam.getEndToken(), StreetItemType.NAME, tt.getMorph(), "реки", nam.name);
            }
            if (tt.isValue("КАДАСТРОВЫЙ", null)) {
                StreetItemToken _next = tryParse(tt.getNext(), prev, inSearch, null);
                if (_next != null && _next.typ == StreetItemType.NOUN && com.pullenti.unisharp.Utils.stringsEq(_next.termin.getCanonicText(), "КВАРТАЛ")) {
                    _next.setBeginToken(tt);
                    return _next;
                }
            }
            if ((t.getPrevious() instanceof com.pullenti.ner.NumberToken) && com.pullenti.unisharp.Utils.stringsEq(((com.pullenti.ner.NumberToken)com.pullenti.unisharp.Utils.cast(t.getPrevious(), com.pullenti.ner.NumberToken.class)).getValue(), "26")) {
                if (tt.isValue("БАКИНСКИЙ", null) || "БАКИНСК".startsWith(((com.pullenti.ner.TextToken)com.pullenti.unisharp.Utils.cast(tt, com.pullenti.ner.TextToken.class)).term)) {
                    com.pullenti.ner.Token tt2 = tt;
                    if (tt2.getNext() != null && tt2.getNext().isChar('.')) 
                        tt2 = tt2.getNext();
                    if (tt2.getNext() instanceof com.pullenti.ner.TextToken) {
                        tt2 = tt2.getNext();
                        if (tt2.isValue("КОМИССАР", null) || tt2.isValue("КОММИССАР", null) || "КОМИС".startsWith(((com.pullenti.ner.TextToken)com.pullenti.unisharp.Utils.cast(tt2, com.pullenti.ner.TextToken.class)).term)) {
                            if (tt2.getNext() != null && tt2.getNext().isChar('.')) 
                                tt2 = tt2.getNext();
                            StreetItemToken sit = _new334(tt, tt2, StreetItemType.STDNAME, true, "БАКИНСКИХ КОМИССАРОВ", tt2.getMorph());
                            return sit;
                        }
                    }
                }
            }
            if ((tt.getNext() != null && ((tt.getNext().isChar('.') || ((tt.getNext().isHiphen() && tt.getLengthChar() == 1)))) && ((!tt.chars.isAllLower() || com.pullenti.ner.geo.internal.MiscLocationHelper.isUserParamAddress(tt)))) && (tt.getNext().getWhitespacesAfterCount() < 3) && (tt.getNext().getNext() instanceof com.pullenti.ner.TextToken)) {
                com.pullenti.ner.Token tt1 = tt.getNext().getNext();
                if (tt1 != null && tt1.isHiphen() && tt1.getNext() != null) 
                    tt1 = tt1.getNext();
                if (tt.getLengthChar() == 1 && tt1.getLengthChar() == 1 && (tt1.getNext() instanceof com.pullenti.ner.TextToken)) {
                    if (tt1.isAnd() && tt1.getNext().chars.isAllUpper() && tt1.getNext().getLengthChar() == 1) 
                        tt1 = tt1.getNext();
                    if ((tt1.chars.isAllUpper() && tt1.getNext() != null && tt1.getNext().isChar('.')) && (tt1.getNext().getWhitespacesAfterCount() < 3) && (tt1.getNext().getNext() instanceof com.pullenti.ner.TextToken)) 
                        tt1 = tt1.getNext().getNext();
                    else if ((tt1.chars.isAllUpper() && (tt1.getWhitespacesAfterCount() < 3) && (tt1.getNext() instanceof com.pullenti.ner.TextToken)) && !tt1.getNext().chars.isAllLower()) 
                        tt1 = tt1.getNext();
                }
                StreetItemToken sit = StreetItemToken.tryParse(tt1, null, false, null);
                if (sit != null) {
                    AddressItemToken ait = AddressItemToken.tryParsePureItem(tt, null, null);
                    if (ait != null) {
                        if (!com.pullenti.unisharp.Utils.isNullOrEmpty(ait.value) && com.pullenti.unisharp.Utils.stringsNe(ait.value, "0") && Character.isDigit(ait.value.charAt(0))) 
                            sit = null;
                    }
                }
                if (sit != null && (tt1 instanceof com.pullenti.ner.TextToken)) {
                    String str = ((com.pullenti.ner.TextToken)com.pullenti.unisharp.Utils.cast(tt1, com.pullenti.ner.TextToken.class)).term;
                    boolean ok = false;
                    com.pullenti.morph.MorphClass mc = tt1.getMorphClassInDictionary();
                    com.pullenti.morph.MorphClass cla = tt.getNext().getNext().getMorphClassInDictionary();
                    if (sit.isInDictionary) 
                        ok = true;
                    else if (sit._isSurname() || cla.isProperSurname()) 
                        ok = true;
                    else if (com.pullenti.morph.LanguageHelper.endsWith(str, "ОЙ") && ((cla.isProperSurname() || ((sit.typ == StreetItemType.NAME && sit.isInDictionary))))) 
                        ok = true;
                    else if (com.pullenti.morph.LanguageHelper.endsWithEx(str, "ГО", "ИХ", "ЫХ", null)) 
                        ok = true;
                    else if ((tt1.isWhitespaceBefore() && !mc.isUndefined() && !mc.isProperSurname()) && !mc.isProperName()) {
                        if (AddressItemToken.checkHouseAfter(sit.getEndToken().getNext(), false, true)) 
                            ok = true;
                    }
                    else if (prev != null && prev.typ == StreetItemType.NOUN && ((!prev.isAbridge || prev.getLengthChar() > 2))) 
                        ok = true;
                    else if ((prev != null && prev.typ == StreetItemType.NAME && sit.typ == StreetItemType.NOUN) && AddressItemToken.checkHouseAfter(sit.getEndToken().getNext(), false, true)) 
                        ok = true;
                    else if (sit.typ == StreetItemType.NAME && AddressItemToken.checkHouseAfter(sit.getEndToken().getNext(), false, true)) {
                        if (com.pullenti.ner.geo.internal.MiscLocationHelper.checkGeoObjectBefore(tt, false)) 
                            ok = true;
                        else {
                            com.pullenti.ner.geo.internal.GeoAnalyzerData ad = com.pullenti.ner.geo.GeoAnalyzer.getData(t);
                            if (!ad.sRegime && SPEEDREGIME) {
                                ok = true;
                                sit.cond = com.pullenti.ner.geo.internal.Condition._new335(tt, true);
                            }
                        }
                    }
                    if (!ok && com.pullenti.ner.geo.internal.MiscLocationHelper.isUserParamAddress(tt) && ((sit.typ == StreetItemType.NAME || sit.typ == StreetItemType.STDADJECTIVE))) {
                        StreetItemToken sit1 = tryParse(sit.getEndToken().getNext(), null, false, null);
                        if (sit1 != null && sit1.typ == StreetItemType.NOUN) 
                            ok = true;
                        else if (AddressItemToken.checkHouseAfter(sit.getEndToken().getNext(), true, false)) 
                            ok = true;
                        else if (sit.getEndToken().isNewlineAfter()) 
                            ok = true;
                    }
                    if (ok) {
                        sit.setBeginToken(tt);
                        if (sit.value == null) 
                            sit.value = str;
                        if (tok != null && ((StreetItemType)tok.termin.tag) == StreetItemType.STDADJECTIVE && !hasNamed) {
                            if ((tok.getEndToken().getNext() instanceof com.pullenti.ner.TextToken) && tok.getEndToken().getNext().getLengthChar() == 1 && tok.getEndToken().getNext().chars.isLetter()) {
                            }
                            else {
                                sit.stdAdjVersion = _new336(tok.getBeginToken(), tok.getEndToken(), StreetItemType.STDADJECTIVE, tok.termin, true);
                                java.util.ArrayList<com.pullenti.ner.core.TerminToken> toks2 = m_Ontology.tryParseAll(tok.getBeginToken(), com.pullenti.ner.core.TerminParseAttr.NO);
                                if (toks2 != null && toks2.size() > 1) 
                                    sit.stdAdjVersion.altTermin = toks2.get(1).termin;
                            }
                        }
                        return sit;
                    }
                }
            }
            if (tt.chars.isCyrillicLetter() && tt.getLengthChar() > 1 && !tt.getMorph()._getClass().isPreposition()) {
                if (((tt.isValue("ОБЪЕЗД", null) || tt.isValue("ОБХОД", null))) && tt.getNext() != null) {
                    if (prev == null) 
                        return null;
                    if (prev.isRoad()) {
                        java.util.ArrayList<com.pullenti.ner.geo.internal.CityItemToken> cits = com.pullenti.ner.geo.internal.CityItemToken.tryParseList(tt.getNext(), 3, null);
                        if (cits != null && (cits.size() < 3)) {
                            StreetItemToken resr = _new337(tt, cits.get(cits.size() - 1).getEndToken(), StreetItemType.NAME, true);
                            for (com.pullenti.ner.geo.internal.CityItemToken ci : cits) {
                                if (ci.typ == com.pullenti.ner.geo.internal.CityItemToken.ItemType.CITY || ci.typ == com.pullenti.ner.geo.internal.CityItemToken.ItemType.PROPERNAME) {
                                    resr.value = "ОБЪЕЗД " + com.pullenti.ner.core.MiscHelper.getTextValueOfMetaToken(ci, com.pullenti.ner.core.GetTextAttr.NO);
                                    break;
                                }
                            }
                            if (resr.value != null) 
                                return resr;
                        }
                    }
                }
                if ((tt.isValue("ГЕРОЙ", null) || tt.isValue("ЗАЩИТНИК", "ЗАХИСНИК") || tt.isValue("ОБРАЗОВАНИЕ", null)) || tt.isValue("ОСВОБОДИТЕЛЬ", "ВИЗВОЛИТЕЛЬ") || tt.isValue("КОНСТИТУЦИЯ", null)) {
                    com.pullenti.ner.Token tt2 = null;
                    if ((tt.getNext() instanceof com.pullenti.ner.ReferentToken) && (tt.getNext().getReferent() instanceof com.pullenti.ner.geo.GeoReferent)) 
                        tt2 = tt.getNext();
                    else {
                        com.pullenti.ner.core.NounPhraseToken npt2 = com.pullenti.ner.geo.internal.MiscLocationHelper.tryParseNpt(tt.getNext());
                        if (npt2 != null && npt2.getMorph().getCase().isGenitive()) 
                            tt2 = npt2.getEndToken();
                        else {
                            com.pullenti.ner.core.IntOntologyToken tee = com.pullenti.ner.geo.internal.TerrItemToken.checkOntoItem(tt.getNext());
                            if (tee != null) 
                                tt2 = tee.getEndToken();
                            else if ((((tee = com.pullenti.ner.geo.internal.CityItemToken.checkOntoItem(tt.getNext())))) != null) 
                                tt2 = tee.getEndToken();
                        }
                    }
                    if (tt2 != null) {
                        StreetItemToken re = _new338(tt, tt2, StreetItemType.STDPARTOFNAME, com.pullenti.ner.core.MiscHelper.getTextValue(tt, tt2, com.pullenti.ner.core.GetTextAttr.NO), true);
                        StreetItemToken sit = tryParse(tt2.getNext(), null, false, null);
                        if (sit == null || sit.typ != StreetItemType.NAME) {
                            boolean ok2 = false;
                            if (sit != null && ((sit.typ == StreetItemType.STDADJECTIVE || sit.typ == StreetItemType.NOUN))) 
                                ok2 = true;
                            else if (AddressItemToken.checkHouseAfter(tt2.getNext(), false, true)) 
                                ok2 = true;
                            else if (tt2.isNewlineAfter()) 
                                ok2 = true;
                            if (ok2) {
                                sit = _new305(tt, tt2, StreetItemType.NAME);
                                sit.value = com.pullenti.ner.core.MiscHelper.getTextValue(tt, tt2, com.pullenti.ner.core.GetTextAttr.NO);
                                if (!tt.isValue("ОБРАЗОВАНИЕ", null)) 
                                    sit.noGeoInThisToken = true;
                                return sit;
                            }
                            return re;
                        }
                        if (sit.value == null) 
                            sit.value = com.pullenti.ner.core.MiscHelper.getTextValueOfMetaToken(sit, com.pullenti.ner.core.GetTextAttr.NO);
                        if (sit.altValue == null) {
                            sit.altValue = sit.value;
                            sit.value = (re.value + " " + sit.value);
                        }
                        else 
                            sit.value = (re.value + " " + sit.value);
                        sit.setBeginToken(tt);
                        return sit;
                    }
                }
                com.pullenti.ner.NumberToken ani = com.pullenti.ner.core.NumberHelper.tryParseAnniversary(t);
                if (ani != null) 
                    return _new340(t, ani.getEndToken(), StreetItemType.AGE, com.pullenti.ner.NumberSpellingType.AGE, ani.getValue());
                com.pullenti.ner.geo.internal.NumToken num1 = com.pullenti.ner.geo.internal.NumToken.tryParse(t, com.pullenti.ner.geo.internal.GeoTokenType.STREET);
                if (num1 != null) 
                    return _new340(t, num1.getEndToken(), StreetItemType.NUMBER, com.pullenti.ner.NumberSpellingType.ROMAN, num1.value);
                if (prev != null && prev.typ == StreetItemType.NOUN) {
                }
                else {
                    com.pullenti.ner.geo.internal.OrgItemToken __org = com.pullenti.ner.geo.internal.OrgItemToken.tryParse(t, null);
                    if (__org != null) {
                        if (__org.isGsk || __org.hasTerrKeyword) 
                            return _new86(t, __org.getEndToken(), StreetItemType.FIX, __org);
                    }
                }
                boolean ok1 = false;
                com.pullenti.ner.geo.internal.Condition _cond = null;
                if (!tt.chars.isAllLower()) {
                    AddressItemToken ait = AddressItemToken.tryParsePureItem(tt, null, null);
                    if (ait != null) {
                        if (tt.getNext() != null && tt.getNext().isHiphen()) 
                            ok1 = true;
                        else if (tt.isValue("БЛОК", null) || tt.isValue("ДОС", null) || ait.getEndToken().isValue("БЛОК", null)) 
                            ok1 = true;
                        else if (tt.isValue("ЖИЛОЙ", null)) {
                            com.pullenti.ner.core.NounPhraseToken npt2 = com.pullenti.ner.core.NounPhraseHelper.tryParse(tt, com.pullenti.ner.core.NounPhraseParseAttr.NO, 0, null);
                            if (npt2 != null) {
                            }
                            else 
                                ok1 = true;
                        }
                        else if (ait.getTyp() == AddressItemType.SPACE && ait.detailParam != null) 
                            ok1 = true;
                        else if ((ait.getTyp() != AddressItemType.NUMBER && ait.getTyp() != AddressItemType.POTCH && ait.getTyp() != AddressItemType.NONUMBER) && ait.getBeginToken() == ait.getEndToken() && !ait.chars.isAllLower()) 
                            ok1 = true;
                    }
                    else 
                        ok1 = true;
                }
                else if (prev != null && (((prev.typ == StreetItemType.NOUN || prev.typ == StreetItemType.STDPARTOFNAME || ((prev.typ == StreetItemType.STDADJECTIVE && t.getPrevious().isHiphen()))) || ((prev.typ == StreetItemType.NUMBER && ((com.pullenti.ner.geo.internal.MiscLocationHelper.isUserParamAddress(prev) || com.pullenti.ner.geo.internal.MiscLocationHelper.isUserParamQuiry(prev)))))))) {
                    if (AddressItemToken.checkHouseAfter(tt.getNext(), false, false)) {
                        if (!AddressItemToken.checkHouseAfter(tt, false, false)) 
                            ok1 = true;
                    }
                    if (!ok1) {
                        com.pullenti.ner.Token tt1 = prev.getBeginToken().getPrevious();
                        if (tt1 != null && tt1.isComma()) 
                            tt1 = tt1.getPrevious();
                        if (tt1 != null && (tt1.getReferent() instanceof com.pullenti.ner.geo.GeoReferent)) 
                            ok1 = true;
                        else if (com.pullenti.ner.geo.internal.MiscLocationHelper.isUserParamAddress(prev) && !AddressItemToken.checkHouseAfter(tt, false, false)) 
                            ok1 = true;
                        else if (t.getPrevious() != null && t.getPrevious().isHiphen()) 
                            ok1 = true;
                        else {
                            com.pullenti.ner.geo.internal.GeoAnalyzerData ad = com.pullenti.ner.geo.GeoAnalyzer.getData(t);
                            if (!ad.sRegime && SPEEDREGIME) {
                                ok1 = true;
                                _cond = com.pullenti.ner.geo.internal.Condition._new335(prev.getBeginToken(), true);
                            }
                        }
                    }
                }
                else if (tt.getWhitespacesAfterCount() < 2) {
                    com.pullenti.ner.core.TerminToken nex = m_Ontology.tryParse(tt.getNext(), com.pullenti.ner.core.TerminParseAttr.NO);
                    if (nex != null && nex.termin != null) {
                        if (com.pullenti.unisharp.Utils.stringsEq(nex.termin.getCanonicText(), "ПЛОЩАДЬ")) {
                            if (tt.isValue("ОБЩИЙ", null)) 
                                return null;
                        }
                        com.pullenti.ner.Token tt1 = tt.getPrevious();
                        if (tt1 != null && tt1.isComma()) 
                            tt1 = tt1.getPrevious();
                        if (tt1 != null && (tt1.getReferent() instanceof com.pullenti.ner.geo.GeoReferent)) 
                            ok1 = true;
                        else if (AddressItemToken.checkHouseAfter(nex.getEndToken().getNext(), false, false)) 
                            ok1 = true;
                        else if (com.pullenti.ner.geo.internal.MiscLocationHelper.isUserParamAddress(tt)) 
                            ok1 = true;
                    }
                    else if (com.pullenti.ner.geo.internal.MiscLocationHelper.isUserParamAddress(tt) && tt.getLengthChar() > 3) {
                        AddressItemToken aaa = AddressItemToken.tryParsePureItem(tt, null, null);
                        if (aaa == null) 
                            ok1 = true;
                        else if (tt.isValue("УГОЛ", null)) 
                            ok1 = true;
                    }
                }
                else if (tt.isNewlineAfter() && tt.getLengthChar() > 2 && com.pullenti.ner.geo.internal.MiscLocationHelper.isUserParamAddress(tt)) 
                    ok1 = true;
                if (ok1) {
                    com.pullenti.morph.MorphClass dc = tt.getMorphClassInDictionary();
                    if (dc.isAdverb() && !com.pullenti.ner.geo.internal.MiscLocationHelper.isUserParamAddress(tt)) {
                        if (!(dc.isProper())) {
                            if (tt.getNext() != null && tt.getNext().isHiphen()) {
                            }
                            else 
                                return null;
                        }
                    }
                    StreetItemToken res = _new344(tt, tt, StreetItemType.NAME, tt.getMorph(), _cond);
                    if ((tt.getNext() != null && (tt.getNext().isHiphen()) && (tt.getNext().getNext() instanceof com.pullenti.ner.TextToken)) && !tt.isWhitespaceAfter() && !tt.getNext().isWhitespaceAfter()) {
                        boolean ok2 = AddressItemToken.checkHouseAfter(tt.getNext().getNext().getNext(), false, false) || tt.getNext().getNext().isNewlineAfter();
                        if (!ok2) {
                            StreetItemToken te2 = tryParse(tt.getNext().getNext().getNext(), null, false, null);
                            if (te2 != null && te2.typ == StreetItemType.NOUN) 
                                ok2 = true;
                        }
                        if (!ok2 && (tt.getNext().getNext().getNext() instanceof com.pullenti.ner.NumberToken)) 
                            ok2 = true;
                        if (((!ok2 && tt.getNext().isHiphen() && !tt.isWhitespaceAfter()) && !tt.getNext().isWhitespaceAfter() && (tt.getNext().getNext() instanceof com.pullenti.ner.TextToken)) && tt.getNext().getNext().getLengthChar() > 3) 
                            ok2 = true;
                        if (ok2) {
                            res.setEndToken(tt.getNext().getNext());
                            if (res.getEndToken().chars.isLatinLetter()) {
                                com.pullenti.ner.NumberToken lat = com.pullenti.ner.core.NumberHelper.tryParseRoman(res.getEndToken());
                                if (lat != null) {
                                    res.value = com.pullenti.ner.core.MiscHelper.getTextValue(tt, tt, com.pullenti.ner.core.GetTextAttr.NO);
                                    res.nextItem = _new299(tt.getNext().getNext(), lat.getEndToken(), StreetItemType.NUMBER, lat.getValue(), true);
                                    res.setEndToken(tt.getNext());
                                    return res;
                                }
                            }
                            if (tt.getMorphClassInDictionary().isProperName() && !((com.pullenti.ner.TextToken)com.pullenti.unisharp.Utils.cast(tt, com.pullenti.ner.TextToken.class)).term.endsWith("О") && res.getEndToken().getMorph()._getClass().isProperSurname()) {
                                res.misc = com.pullenti.ner.core.MiscHelper.getTextValue(tt, tt, com.pullenti.ner.core.GetTextAttr.NO);
                                res.value = com.pullenti.ner.core.MiscHelper.getTextValue(res.getEndToken(), res.getEndToken(), com.pullenti.ner.core.GetTextAttr.NO);
                            }
                            else 
                                res.value = (com.pullenti.ner.core.MiscHelper.getTextValue(tt, tt, com.pullenti.ner.core.GetTextAttr.NO) + " " + com.pullenti.ner.core.MiscHelper.getTextValue(res.getEndToken(), res.getEndToken(), com.pullenti.ner.core.GetTextAttr.NO));
                        }
                    }
                    else if ((tt.getWhitespacesAfterCount() < 2) && (tt.getNext() instanceof com.pullenti.ner.TextToken) && tt.getNext().chars.isLetter()) {
                        if (tt.getNext().isValue("БИ", null) || tt.getNext().isValue("АТА", null) || tt.getNext().isValue("СУ", null)) {
                            if (res.value == null) 
                                res.value = com.pullenti.ner.core.MiscHelper.getTextValue(tt, tt, com.pullenti.ner.core.GetTextAttr.NO);
                            res.setEndToken(tt.getNext());
                            res.value = (res.value + " " + ((com.pullenti.ner.TextToken)com.pullenti.unisharp.Utils.cast(tt.getNext(), com.pullenti.ner.TextToken.class)).term);
                            if (res.altValue != null) 
                                res.altValue = (res.altValue + " " + ((com.pullenti.ner.TextToken)com.pullenti.unisharp.Utils.cast(tt.getNext(), com.pullenti.ner.TextToken.class)).term);
                        }
                        else if (!AddressItemToken.checkHouseAfter(tt.getNext(), false, false) || tt.getNext().isNewlineAfter()) {
                            com.pullenti.ner.Token tt1 = tt.getNext();
                            boolean isPref = false;
                            if (tt1 instanceof com.pullenti.ner.TextToken) {
                                if (tt1.isValue("ДЕ", null) || tt1.isValue("ЛА", null)) {
                                    tt1 = tt1.getNext();
                                    isPref = true;
                                }
                            }
                            StreetItemToken nn = tryParse(tt1, null, false, null);
                            if (nn == null || nn.typ == StreetItemType.NAME) {
                                npt = com.pullenti.ner.geo.internal.MiscLocationHelper.tryParseNpt(tt);
                                if (npt != null) {
                                    if (npt.getBeginToken() == npt.getEndToken()) 
                                        npt = null;
                                    else if (m_Ontology.tryParse(npt.getEndToken(), com.pullenti.ner.core.TerminParseAttr.NO) != null) 
                                        npt = null;
                                }
                                if (npt != null && ((npt.isNewlineAfter() || AddressItemToken.checkHouseAfter(npt.getEndToken().getNext(), false, false) || ((npt.getEndToken().getNext() != null && npt.getEndToken().getNext().isCommaAnd()))))) {
                                    res.setEndToken(npt.getEndToken());
                                    if (npt.getMorph().getCase().isGenitive()) {
                                        res.value = com.pullenti.ner.core.MiscHelper.getTextValueOfMetaToken(npt, com.pullenti.ner.core.GetTextAttr.NO);
                                        res.altValue = npt.getNormalCaseText(null, com.pullenti.morph.MorphNumber.UNDEFINED, com.pullenti.morph.MorphGender.UNDEFINED, false);
                                    }
                                    else {
                                        res.value = npt.getNormalCaseText(null, com.pullenti.morph.MorphNumber.UNDEFINED, com.pullenti.morph.MorphGender.UNDEFINED, false);
                                        res.altValue = com.pullenti.ner.core.MiscHelper.getTextValueOfMetaToken(npt, com.pullenti.ner.core.GetTextAttr.NO);
                                    }
                                }
                                else if ((nn != null && t.getLengthChar() >= 3 && t.getMorphClassInDictionary().isProperName()) && ((nn.getBeginToken().getMorph()._getClass().isProperSurname() || nn.getEndToken().getMorph()._getClass().isProperSurname() || nn.getBeginToken().getMorph()._getClass().isProperSecname()))) {
                                    res.setEndToken(nn.getEndToken());
                                    if (nn.getBeginToken().getNext() == nn.getEndToken() && nn.getBeginToken().getMorph()._getClass().isProperSecname()) 
                                        res.value = com.pullenti.ner.core.MiscHelper.getTextValue(nn.getBeginToken().getNext(), nn.getEndToken(), com.pullenti.ner.core.GetTextAttr.NO);
                                    else if (nn.ortoTerr != null) {
                                        res.value = com.pullenti.ner.core.MiscHelper.getTextValue(nn.getBeginToken(), nn.getBeginToken(), com.pullenti.ner.core.GetTextAttr.NO);
                                        res.ortoTerr = nn.ortoTerr;
                                    }
                                    else 
                                        res.value = com.pullenti.ner.core.MiscHelper.getTextValueOfMetaToken(nn, com.pullenti.ner.core.GetTextAttr.NO);
                                    res.misc = com.pullenti.ner.core.MiscHelper.getTextValue(t, t, com.pullenti.ner.core.GetTextAttr.NO);
                                    if (nn.getBeginToken().getMorph()._getClass().isProperSecname() && nn.getEndToken().getNext() != null && nn.getEndToken().getNext().getMorph()._getClass().isProperSurname()) {
                                        res.setEndToken(nn.getEndToken().getNext());
                                        res.value = com.pullenti.ner.core.MiscHelper.getTextValue(res.getEndToken(), res.getEndToken(), com.pullenti.ner.core.GetTextAttr.NO);
                                    }
                                }
                                else if ((tt1 != null && tt1.getLengthChar() > 2 && AddressItemToken.checkHouseAfter(tt1.getNext(), false, false)) && tt1.chars.isCyrillicLetter() == tt.chars.isCyrillicLetter() && (t.getWhitespacesAfterCount() < 2)) {
                                    if (tt1.getMorph()._getClass().isVerb() && !tt1.isValue("ДАЛИ", null)) {
                                    }
                                    else if (npt == null && ((!tt1.chars.isAllLower() || com.pullenti.ner.geo.internal.MiscLocationHelper.isUserParamAddress(tt1))) && !isPref) {
                                    }
                                    else {
                                        res.setEndToken(tt1);
                                        res.value = (com.pullenti.ner.core.MiscHelper.getTextValue(res.getBeginToken(), res.getBeginToken(), com.pullenti.ner.core.GetTextAttr.NO) + " " + com.pullenti.ner.core.MiscHelper.getTextValue(res.getEndToken(), res.getEndToken(), com.pullenti.ner.core.GetTextAttr.NO));
                                    }
                                }
                                else if (nn != null && nn.getBeginToken().getNext() == nn.getEndToken() && nn.getEndToken().getMorph()._getClass().isProperSurname()) {
                                    res.setEndToken(nn.getEndToken());
                                    if (nn.misc != null && nn.getEndToken().getMorph()._getClass().isProperSecname()) {
                                        res.value = com.pullenti.ner.core.MiscHelper.getTextValue(t, t, com.pullenti.ner.core.GetTextAttr.NO);
                                        res.misc = nn.misc;
                                    }
                                    else {
                                        res.value = com.pullenti.ner.core.MiscHelper.getTextValue(nn.getEndToken(), nn.getEndToken(), com.pullenti.ner.core.GetTextAttr.NO);
                                        res.misc = com.pullenti.ner.core.MiscHelper.getTextValue(t, t, com.pullenti.ner.core.GetTextAttr.NO);
                                    }
                                }
                            }
                            else if (nn.typ == StreetItemType.NOUN) {
                                com.pullenti.morph.MorphGender gen = nn.termin.getGender();
                                if (gen == com.pullenti.morph.MorphGender.UNDEFINED) {
                                    npt = com.pullenti.ner.geo.internal.MiscLocationHelper.tryParseNpt(tt);
                                    if (npt != null && npt.getEndToken() == nn.getEndToken()) 
                                        gen = npt.getMorph().getGender();
                                    else if (prev != null && prev.typ == StreetItemType.NOUN) 
                                        gen = prev.termin.getGender();
                                }
                                else 
                                    for (com.pullenti.morph.MorphBaseInfo ii : tt.getMorph().getItems()) {
                                        if (((ii._getClass().isProperSurname() || ii._getClass().isNoun())) && ii.getCase().isGenitive() && (ii instanceof com.pullenti.morph.MorphWordForm)) {
                                            if (((com.pullenti.morph.MorphWordForm)com.pullenti.unisharp.Utils.cast(ii, com.pullenti.morph.MorphWordForm.class)).isInDictionary()) {
                                                gen = com.pullenti.morph.MorphGender.UNDEFINED;
                                                break;
                                            }
                                        }
                                    }
                                if (gen != com.pullenti.morph.MorphGender.UNDEFINED && ((!nn.getMorph().getCase().isNominative() || nn.getMorph().getNumber() != com.pullenti.morph.MorphNumber.SINGULAR))) {
                                    res.value = com.pullenti.ner.core.MiscHelper.getTextValue(res.getBeginToken(), res.getEndToken(), com.pullenti.ner.core.GetTextAttr.NO);
                                    String var = null;
                                    try {
                                        var = com.pullenti.morph.MorphologyService.getWordform(res.value, com.pullenti.morph.MorphBaseInfo._new346(com.pullenti.morph.MorphCase.NOMINATIVE, com.pullenti.morph.MorphClass.ADJECTIVE, com.pullenti.morph.MorphNumber.SINGULAR, gen));
                                    } catch (Exception ex) {
                                    }
                                    if (var != null && var.endsWith("ОЙ") && !res.getBeginToken().getMorphClassInDictionary().isAdjective()) {
                                        if (gen == com.pullenti.morph.MorphGender.MASCULINE) 
                                            var = var.substring(0, 0 + var.length() - 2) + "ЫЙ";
                                        else if (gen == com.pullenti.morph.MorphGender.NEUTER) 
                                            var = var.substring(0, 0 + var.length() - 2) + "ОЕ";
                                        else if (gen == com.pullenti.morph.MorphGender.FEMINIE) 
                                            var = var.substring(0, 0 + var.length() - 2) + "АЯ";
                                    }
                                    if (var != null && com.pullenti.unisharp.Utils.stringsNe(var, res.value)) {
                                        res.altValue = res.value;
                                        res.value = var;
                                    }
                                }
                            }
                        }
                    }
                    if (res != null && res.typ == StreetItemType.NAME && (res.getWhitespacesAfterCount() < 2)) {
                        tt = (com.pullenti.ner.TextToken)com.pullenti.unisharp.Utils.cast(res.getEndToken().getNext(), com.pullenti.ner.TextToken.class);
                        if (com.pullenti.ner.geo.internal.MiscLocationHelper.isUserParamAddress(tt) && tt.isChar('.')) 
                            tt = (com.pullenti.ner.TextToken)com.pullenti.unisharp.Utils.cast(tt.getNext(), com.pullenti.ner.TextToken.class);
                        if (com.pullenti.ner.geo.internal.NameToken.checkInitialBack(tt)) {
                            if (res.value == null) 
                                res.value = com.pullenti.ner.core.MiscHelper.getTextValueOfMetaToken(res, com.pullenti.ner.core.GetTextAttr.NO);
                            if (tt.getNext() != null && tt.getNext().isChar('.')) 
                                tt = (com.pullenti.ner.TextToken)com.pullenti.unisharp.Utils.cast(tt.getNext(), com.pullenti.ner.TextToken.class);
                            res.setEndToken(tt);
                            tt = (com.pullenti.ner.TextToken)com.pullenti.unisharp.Utils.cast(res.getEndToken().getNext(), com.pullenti.ner.TextToken.class);
                            if ((((res.getWhitespacesAfterCount() < 2) && tt != null && tt.getLengthChar() == 1) && tt.chars.isAllUpper() && tt.getNext() != null) && tt.getNext().isChar('.')) 
                                res.setEndToken(tt.getNext());
                            tt = (com.pullenti.ner.TextToken)com.pullenti.unisharp.Utils.cast(res.getEndToken().getNext(), com.pullenti.ner.TextToken.class);
                        }
                        else if ((tt != null && tt.getLengthChar() == 1 && tt.getNext() != null) && ((tt.chars.isAllUpper() || ((com.pullenti.ner.geo.internal.MiscLocationHelper.isUserParamAddress(tt) && tt.getNext().isChar('.'))))) && tt.getNext().isCharOf(".,")) {
                            if (tryParse(tt, null, false, null) != null || ((!tt.getNext().isComma() && AddressItemToken.checkHouseAfter(tt, false, false)))) {
                            }
                            else if (AddressItemToken.checkHouseAfter(tt.getNext().getNext(), false, false)) {
                                if (tt.isValue("Ш", null)) {
                                }
                                else {
                                    if (res.value == null) 
                                        res.value = com.pullenti.ner.core.MiscHelper.getTextValueOfMetaToken(res, com.pullenti.ner.core.GetTextAttr.NO);
                                    res.setEndToken(tt);
                                    if (tt.getNext() != null && tt.getNext().isChar('.')) 
                                        res.setEndToken(tt.getNext());
                                }
                            }
                            else {
                                com.pullenti.ner.ReferentToken rt = tt.kit.processReferent("PERSON", tt, null);
                                if (rt == null) {
                                    if (res.value == null) 
                                        res.value = com.pullenti.ner.core.MiscHelper.getTextValueOfMetaToken(res, com.pullenti.ner.core.GetTextAttr.NO);
                                    res.setEndToken(tt.getNext());
                                    tt = (com.pullenti.ner.TextToken)com.pullenti.unisharp.Utils.cast(res.getEndToken().getNext(), com.pullenti.ner.TextToken.class);
                                    if (((res.getWhitespacesAfterCount() < 2) && tt != null && tt.getLengthChar() == 1) && ((tt.chars.isAllUpper() || com.pullenti.ner.geo.internal.MiscLocationHelper.isUserParamAddress(tt)))) {
                                        if (AddressItemToken.tryParsePureItem(tt, null, null) == null) {
                                            if (tt.getNext() != null && tt.getNext().isChar('.')) 
                                                res.setEndToken(tt.getNext());
                                            else if (tt.getNext() == null || tt.getNext().isComma()) 
                                                res.setEndToken(tt);
                                        }
                                    }
                                }
                            }
                        }
                        if (tt != null && tt.getMorphClassInDictionary().isProperName()) {
                            com.pullenti.ner.ReferentToken rt = tt.kit.processReferent("PERSON", res.getBeginToken(), null);
                            if (rt != null) {
                                boolean ok2 = false;
                                if (rt.getEndToken() == tt) 
                                    ok2 = true;
                                else if (rt.getEndToken() == tt.getNext() && tt.getNext().getMorphClassInDictionary().isProperSecname()) 
                                    ok2 = true;
                                if (ok2) {
                                    if (res.value == null) 
                                        res.value = com.pullenti.ner.core.MiscHelper.getTextValueOfMetaToken(res, com.pullenti.ner.core.GetTextAttr.NO);
                                    res.setEndToken(rt.getEndToken());
                                    if (res.getBeginToken() != res.getEndToken()) {
                                        com.pullenti.morph.MorphClass mc1 = res.getBeginToken().getMorphClassInDictionary();
                                        com.pullenti.morph.MorphClass mc2 = res.getEndToken().getMorphClassInDictionary();
                                        if (((mc1.isProperName() && !mc2.isProperName())) || ((!mc1.isProperSurname() && mc2.isProperSurname()))) {
                                            res.misc = res.value;
                                            res.value = com.pullenti.ner.core.MiscHelper.getTextValue(res.getEndToken(), res.getEndToken(), com.pullenti.ner.core.GetTextAttr.NO);
                                        }
                                        else if (mc1.isProperName() && ((mc2.isProperSurname() || mc2.isProperName() || mc2.isUndefined()))) {
                                            res.misc = res.value;
                                            res.value = com.pullenti.ner.core.MiscHelper.getTextValue(res.getEndToken(), res.getEndToken(), com.pullenti.ner.core.GetTextAttr.NO);
                                        }
                                        else {
                                            com.pullenti.ner.ReferentToken pp = res.kit.processReferent("PERSONPROPERTY", res.getBeginToken(), null);
                                            if (pp != null && pp.getEndToken() == res.getEndToken().getPrevious() && !mc1.isProperSurname()) {
                                                res.misc = res.value;
                                                res.value = com.pullenti.ner.core.MiscHelper.getTextValue(res.getEndToken(), res.getEndToken(), com.pullenti.ner.core.GetTextAttr.NO);
                                            }
                                            else if ((res.getBeginToken().getMorph()._getClass().isProperSurname() && res.getBeginToken().getNext().getMorph()._getClass().isProperName() && res.getBeginToken().getNext().getNext() == res.getEndToken()) && res.getEndToken().getMorph()._getClass().isProperSecname()) 
                                                res.misc = com.pullenti.ner.core.MiscHelper.getTextValue(res.getEndToken().getPrevious(), res.getEndToken().getPrevious(), com.pullenti.ner.core.GetTextAttr.NO);
                                            else 
                                                res.misc = com.pullenti.ner.core.MiscHelper.getTextValue(res.getEndToken(), res.getEndToken(), com.pullenti.ner.core.GetTextAttr.NO);
                                        }
                                    }
                                }
                            }
                        }
                    }
                    if (res.getBeginToken() == res.getEndToken()) {
                        com.pullenti.ner.MetaToken nn = com.pullenti.ner.geo.internal.MiscLocationHelper.tryAttachNordWest(res.getBeginToken());
                        if (nn != null && nn.getEndChar() > res.getEndChar()) {
                            res.setEndToken(nn.getEndToken());
                            res.value = com.pullenti.ner.core.MiscHelper.getTextValueOfMetaToken(res, com.pullenti.ner.core.GetTextAttr.NO).replace(" - ", " ");
                        }
                        else if (res.typ == StreetItemType.NAME) {
                            int cou = 0;
                            for (com.pullenti.ner.Token ttt = res.getEndToken().getNext(); ttt != null && (cou < 2); ttt = ttt.getNext(),cou++) {
                                if (!ttt.isHiphen()) 
                                    break;
                                if (ttt.isWhitespaceBefore() || ttt.isWhitespaceAfter()) 
                                    break;
                                if (!(ttt.getNext() instanceof com.pullenti.ner.TextToken) || (ttt.getNext().getLengthChar() < 2) || ttt.getNext().chars.isLatinLetter()) 
                                    break;
                                if (m_Ontology.tryParse(ttt.getNext(), com.pullenti.ner.core.TerminParseAttr.NO) != null) 
                                    break;
                                ttt = ttt.getNext();
                                if (res.value == null) 
                                    res.value = com.pullenti.ner.core.MiscHelper.getTextValueOfMetaToken(res, com.pullenti.ner.core.GetTextAttr.NO);
                                res.value = (res.value + " " + ((com.pullenti.ner.TextToken)com.pullenti.unisharp.Utils.cast(ttt, com.pullenti.ner.TextToken.class)).term);
                                if (res.altValue != null) 
                                    res.altValue = (res.altValue + " " + ((com.pullenti.ner.TextToken)com.pullenti.unisharp.Utils.cast(ttt, com.pullenti.ner.TextToken.class)).term);
                                res.setEndToken(ttt);
                            }
                        }
                    }
                    return res;
                }
            }
            if (tt.isValue("№", null) || tt.isValue("НОМЕР", null) || tt.isValue("НОМ", null)) {
                com.pullenti.ner.Token tt1 = tt.getNext();
                if (tt1 != null && tt1.isChar('.')) 
                    tt1 = tt1.getNext();
                if ((tt1 instanceof com.pullenti.ner.NumberToken) && ((com.pullenti.ner.NumberToken)com.pullenti.unisharp.Utils.cast(tt1, com.pullenti.ner.NumberToken.class)).getIntValue() != null) 
                    return _new347(tt, tt1, StreetItemType.NUMBER, ((com.pullenti.ner.NumberToken)com.pullenti.unisharp.Utils.cast(tt1, com.pullenti.ner.NumberToken.class)).typ, ((com.pullenti.ner.NumberToken)com.pullenti.unisharp.Utils.cast(tt1, com.pullenti.ner.NumberToken.class)).getValue(), true);
            }
            if (tt.isHiphen() && (tt.getNext() instanceof com.pullenti.ner.NumberToken) && ((com.pullenti.ner.NumberToken)com.pullenti.unisharp.Utils.cast(tt.getNext(), com.pullenti.ner.NumberToken.class)).getIntValue() != null) {
                if (prev != null && prev.typ == StreetItemType.NOUN) {
                    if ((prev.nounCanBeName || com.pullenti.unisharp.Utils.stringsEq(prev.termin.getCanonicText(), "МИКРОРАЙОН") || com.pullenti.unisharp.Utils.stringsEq(prev.termin.getCanonicText(), "КВАРТАЛ")) || com.pullenti.morph.LanguageHelper.endsWith(prev.termin.getCanonicText(), "ГОРОДОК")) 
                        return _new347(tt, tt.getNext(), StreetItemType.NUMBER, ((com.pullenti.ner.NumberToken)com.pullenti.unisharp.Utils.cast(tt.getNext(), com.pullenti.ner.NumberToken.class)).typ, ((com.pullenti.ner.NumberToken)com.pullenti.unisharp.Utils.cast(tt.getNext(), com.pullenti.ner.NumberToken.class)).getValue(), true);
                }
            }
            if (((tt instanceof com.pullenti.ner.TextToken) && tt.getLengthChar() == 1 && (tt.getWhitespacesBeforeCount() < 2)) && tt.chars.isLetter() && tt.chars.isAllUpper()) {
                if (prev != null && prev.typ == StreetItemType.NOUN) {
                    com.pullenti.ner.geo.internal.NumToken nn = com.pullenti.ner.geo.internal.NumToken.tryParse(tt, com.pullenti.ner.geo.internal.GeoTokenType.STRONG);
                    if (nn != null) {
                        if (nn.getEndToken() != tt) 
                            return _new285(tt, nn.getEndToken(), StreetItemType.NUMBER, nn.value);
                        if (com.pullenti.unisharp.Utils.stringsEq(prev.termin.getCanonicText(), "МИКРОРАЙОН") || com.pullenti.unisharp.Utils.stringsEq(prev.termin.getCanonicText(), "КВАРТАЛ") || com.pullenti.morph.LanguageHelper.endsWith(prev.termin.getCanonicText(), "ГОРОДОК")) 
                            return _new285(tt, nn.getEndToken(), StreetItemType.NUMBER, nn.value);
                        if ((com.pullenti.unisharp.Utils.stringsEq(prev.termin.getCanonicText(), "РЯД") || com.pullenti.unisharp.Utils.stringsEq(prev.termin.getCanonicText(), "БЛОК") || com.pullenti.unisharp.Utils.stringsEq(prev.termin.getCanonicText(), "ЛИНИЯ")) || com.pullenti.unisharp.Utils.stringsEq(prev.termin.getCanonicText(), "ПАНЕЛЬ")) 
                            return _new285(tt, nn.getEndToken(), StreetItemType.NUMBER, nn.value);
                    }
                    if (com.pullenti.ner.geo.internal.MiscLocationHelper.isUserParamAddress(tt)) {
                        StreetItemToken _next = tryParse(tt.getNext(), prev, inSearch, null);
                        if (_next != null && _next.typ == StreetItemType.NAME) {
                            _next = _next.clone();
                            _next.value = com.pullenti.ner.core.MiscHelper.getTextValueOfMetaToken(_next, com.pullenti.ner.core.GetTextAttr.NO);
                            _next.setBeginToken(tt);
                            return _next;
                        }
                        if (prev != null && prev.typ == StreetItemType.NOUN) 
                            return _new285(tt, tt, StreetItemType.NAME, ((com.pullenti.ner.TextToken)com.pullenti.unisharp.Utils.cast(tt, com.pullenti.ner.TextToken.class)).term);
                    }
                }
            }
        }
        com.pullenti.ner.Referent r = (t == null ? null : t.getReferent());
        if (r instanceof com.pullenti.ner.geo.GeoReferent) {
            com.pullenti.ner.geo.GeoReferent geo = (com.pullenti.ner.geo.GeoReferent)com.pullenti.unisharp.Utils.cast(r, com.pullenti.ner.geo.GeoReferent.class);
            if (prev != null && prev.typ == StreetItemType.NOUN) {
                if (AddressItemToken.checkHouseAfter(t.getNext(), false, false)) {
                    StreetItemToken res1 = tryParse(((com.pullenti.ner.ReferentToken)com.pullenti.unisharp.Utils.cast(t, com.pullenti.ner.ReferentToken.class)).getBeginToken(), prev, false, null);
                    if (res1 != null && res1.getEndChar() == t.getEndChar()) {
                        res1 = res1.clone();
                        res1.setBeginToken(res1.setEndToken(t));
                        return res1;
                    }
                    StreetItemToken res = _new285(t, t, StreetItemType.NAME, com.pullenti.ner.core.MiscHelper.getTextValue(t, t, com.pullenti.ner.core.GetTextAttr.NO));
                    return res;
                }
            }
        }
        if (((tt instanceof com.pullenti.ner.TextToken) && tt.chars.isCapitalUpper() && tt.chars.isLatinLetter()) && (tt.getWhitespacesAfterCount() < 2)) {
            if (com.pullenti.ner.core.MiscHelper.isEngArticle(tt)) 
                return null;
            com.pullenti.ner.Token tt2 = tt.getNext();
            if (com.pullenti.ner.core.MiscHelper.isEngAdjSuffix(tt2)) 
                tt2 = tt2.getNext().getNext();
            com.pullenti.ner.core.TerminToken tok1 = m_Ontology.tryParse(tt2, com.pullenti.ner.core.TerminParseAttr.NO);
            if (tok1 != null) 
                return _new322(tt, tt2.getPrevious(), StreetItemType.NAME, tt.getMorph(), ((com.pullenti.ner.TextToken)com.pullenti.unisharp.Utils.cast(tt, com.pullenti.ner.TextToken.class)).term);
        }
        if (((prev != null && prev.typ == StreetItemType.NAME && prev.getBeginToken() == prev.getEndToken()) && (tt instanceof com.pullenti.ner.TextToken) && tt.chars.isLatinLetter()) && tt.getPrevious() != null && tt.getPrevious().getMorphClassInDictionary().isProperName()) {
            com.pullenti.ner.NumberToken num = com.pullenti.ner.core.NumberHelper.tryParseRoman(tt);
            if (num != null) 
                return _new285(tt, num.getEndToken(), StreetItemType.NUMBER, num.getValue());
        }
        if (((tt != null && tt.isValue("ПОДЪЕЗД", null) && prev != null) && prev.isRoad() && tt.getNext() != null) && tt.getNext().isValue("К", null) && tt.getNext().getNext() != null) {
            StreetItemToken sit = _new305(tt, tt.getNext(), StreetItemType.NAME);
            sit.isRoadName = true;
            com.pullenti.ner.Token t1 = tt.getNext().getNext();
            com.pullenti.ner.geo.GeoReferent g1 = null;
            for (; t1 != null; t1 = t1.getNext()) {
                if (t1.getWhitespacesBeforeCount() > 3) 
                    break;
                if ((((g1 = (com.pullenti.ner.geo.GeoReferent)com.pullenti.unisharp.Utils.cast(t1.getReferent(), com.pullenti.ner.geo.GeoReferent.class)))) != null) 
                    break;
                if (t1.isChar('.') || (t1.getLengthChar() < 3)) 
                    continue;
                if ((t1.getLengthChar() < 4) && t1.chars.isAllLower()) 
                    continue;
                break;
            }
            if (g1 != null) {
                sit.setEndToken(t1);
                java.util.ArrayList<String> nams = g1.getStringValues(com.pullenti.ner.geo.GeoReferent.ATTR_NAME);
                if (nams == null || nams.size() == 0) 
                    return null;
                sit.value = "ПОДЪЕЗД - " + nams.get(0);
                if (nams.size() > 1) 
                    sit.altValue = "ПОДЪЕЗД - " + nams.get(1);
                return sit;
            }
            if ((t1 instanceof com.pullenti.ner.TextToken) && (t1.getWhitespacesBeforeCount() < 2) && t1.chars.isCapitalUpper()) {
                com.pullenti.ner.geo.internal.CityItemToken cit = com.pullenti.ner.geo.internal.CityItemToken.tryParse(t1, null, true, null);
                if (cit != null && ((cit.typ == com.pullenti.ner.geo.internal.CityItemToken.ItemType.PROPERNAME || cit.typ == com.pullenti.ner.geo.internal.CityItemToken.ItemType.CITY))) {
                    sit.setEndToken(cit.getEndToken());
                    sit.value = "ПОДЪЕЗД - " + cit.value;
                    return sit;
                }
            }
        }
        if (tt != null && tt.getLengthChar() == 1) {
            com.pullenti.ner.Token t1 = com.pullenti.ner.geo.internal.NameToken.checkInitial(tt);
            if (t1 != null) {
                StreetItemToken res = tryParse(t1, null, false, null);
                if (res != null) {
                    if (res.value == null) 
                        res.value = com.pullenti.ner.core.MiscHelper.getTextValueOfMetaToken(res, com.pullenti.ner.core.GetTextAttr.NO);
                    res.setBeginToken(tt);
                    return res;
                }
            }
        }
        return null;
    }

    public static java.util.ArrayList<StreetItemToken> tryParseSpec(com.pullenti.ner.Token t, StreetItemToken prev) {
        if (t == null) 
            return null;
        java.util.ArrayList<StreetItemToken> res = null;
        StreetItemToken sit;
        if (t.isValue2("ЗА", "ЛИНИЕЙ")) {
            AddressItemToken _next = AddressItemToken.tryParse(t.getNext().getNext(), false, null, null);
            if (_next != null) {
                sit = _new305(t, _next.getEndToken(), StreetItemType.STDNAME);
                String nnn = (_next.referent != null ? _next.referent.toString().toUpperCase() : _next.toString().toUpperCase());
                if (nnn.startsWith("ТЕРРИТОРИЯ ")) 
                    nnn = nnn.substring(11);
                sit.value = "ЗА ЛИНИЕЙ " + nnn;
                res = new java.util.ArrayList<StreetItemToken>();
                res.add(sit);
                return res;
            }
        }
        if (t.getReferent() instanceof com.pullenti.ner.date.DateReferent) {
            com.pullenti.ner.date.DateReferent dr = (com.pullenti.ner.date.DateReferent)com.pullenti.unisharp.Utils.cast(t.getReferent(), com.pullenti.ner.date.DateReferent.class);
            if (!(((com.pullenti.ner.ReferentToken)com.pullenti.unisharp.Utils.cast(t, com.pullenti.ner.ReferentToken.class)).getBeginToken() instanceof com.pullenti.ner.NumberToken)) {
                if (dr.getMonth() > 0 && ((com.pullenti.ner.ReferentToken)com.pullenti.unisharp.Utils.cast(t, com.pullenti.ner.ReferentToken.class)).getBeginToken() == ((com.pullenti.ner.ReferentToken)com.pullenti.unisharp.Utils.cast(t, com.pullenti.ner.ReferentToken.class)).getEndToken()) {
                    res = new java.util.ArrayList<StreetItemToken>();
                    res.add((sit = _new285(t, t, StreetItemType.STDNAME, com.pullenti.ner.core.MiscHelper.getTextValueOfMetaToken((com.pullenti.ner.ReferentToken)com.pullenti.unisharp.Utils.cast(t, com.pullenti.ner.ReferentToken.class), com.pullenti.ner.core.GetTextAttr.NO))));
                    return res;
                }
                return null;
            }
            if (dr.getYear() == 0 && dr.getDay() > 0 && dr.getMonth() > 0) {
                res = new java.util.ArrayList<StreetItemToken>();
                res.add(_new359(t, t, StreetItemType.NUMBER, true, com.pullenti.ner.NumberSpellingType.DIGIT, ((Integer)dr.getDay()).toString()));
                String tmp = dr.toStringEx(false, t.getMorph().getLanguage(), 0);
                int i = tmp.indexOf(' ');
                res.add((sit = _new285(t, t, StreetItemType.STDNAME, tmp.substring(i + 1).toUpperCase())));
                sit.chars.setCapitalUpper(true);
                return res;
            }
            if (dr.getYear() > 0 && dr.getMonth() == 0) {
                res = new java.util.ArrayList<StreetItemToken>();
                res.add(_new359(t, t, StreetItemType.NUMBER, true, com.pullenti.ner.NumberSpellingType.DIGIT, ((Integer)dr.getYear()).toString()));
                res.add((sit = _new285(t, t, StreetItemType.STDNAME, (t.getMorph().getLanguage().isUa() ? "РОКУ" : "ГОДА"))));
                sit.chars.setCapitalUpper(true);
                return res;
            }
            return null;
        }
        if (prev != null && prev.typ == StreetItemType.AGE) {
            res = new java.util.ArrayList<StreetItemToken>();
            if (t.getReferent() instanceof com.pullenti.ner.geo.GeoReferent) 
                res.add((sit = _new363(t, t, StreetItemType.NAME, t.getSourceText().toUpperCase(), t.getReferent().toStringEx(true, t.kit.baseLanguage, 0).toUpperCase())));
            else if (t.isValue("ГОРОД", null) || t.isValue("МІСТО", null)) 
                res.add((sit = _new285(t, t, StreetItemType.NAME, "ГОРОДА")));
            else 
                return null;
            return res;
        }
        if (prev != null && prev.typ == StreetItemType.NOUN) {
            if (t instanceof com.pullenti.ner.NumberToken) {
                com.pullenti.ner.geo.internal.NameToken nam = com.pullenti.ner.geo.internal.NameToken.tryParse(t, com.pullenti.ner.geo.internal.GeoTokenType.STREET, 0, false);
                if (nam != null && nam.number == null && nam.pref == null) {
                    res = new java.util.ArrayList<StreetItemToken>();
                    res.add((sit = _new285(nam.getBeginToken(), nam.getEndToken(), StreetItemType.STDNAME, nam.name)));
                    return res;
                }
            }
            com.pullenti.ner.geo.internal.NumToken num = com.pullenti.ner.geo.internal.NumToken.tryParse(t, com.pullenti.ner.geo.internal.GeoTokenType.STREET);
            if (num != null) {
                res = new java.util.ArrayList<StreetItemToken>();
                res.add((sit = _new285(num.getBeginToken(), num.getEndToken(), StreetItemType.NUMBER, num.value)));
                return res;
            }
        }
        boolean canBeRoad = false;
        if (prev != null && prev.isRoad() && (t.getWhitespacesBeforeCount() < 3)) 
            canBeRoad = true;
        else if (((prev == null && t.getNext() != null && t.getNext().isHiphen()) && com.pullenti.ner.geo.internal.MiscLocationHelper.isUserParamAddress(t) && t.getNext().getNext() != null) && t.getNext().getNext().getLengthChar() > 1) {
            int cou = 5;
            for (com.pullenti.ner.Token tt = t.getNext(); tt != null && cou > 0; tt = tt.getNext(),cou--) {
                if (tt.getWhitespacesBeforeCount() > 3) 
                    break;
                if ((tt instanceof com.pullenti.ner.NumberToken) || tt.isComma()) 
                    break;
                StreetItemToken sit1 = tryParse(tt, null, false, null);
                if (sit1 != null && sit1.typ == StreetItemType.NOUN) {
                    if (sit1.isRoad()) 
                        canBeRoad = true;
                    break;
                }
            }
        }
        if (canBeRoad) {
            java.util.ArrayList<String> vals = null;
            com.pullenti.ner.Token t1 = null;
            boolean br = false;
            for (com.pullenti.ner.Token tt = t; tt != null; tt = tt.getNext()) {
                if (tt.getWhitespacesBeforeCount() > 3 && tt != t) 
                    break;
                if (com.pullenti.ner.core.BracketHelper.isBracket(tt, false)) {
                    if (tt == t) {
                        br = true;
                        continue;
                    }
                    break;
                }
                String val = null;
                if (tt.getReferent() instanceof com.pullenti.ner.geo.GeoReferent) {
                    com.pullenti.ner.ReferentToken rt = (com.pullenti.ner.ReferentToken)com.pullenti.unisharp.Utils.cast(tt, com.pullenti.ner.ReferentToken.class);
                    if (rt.getBeginToken() == rt.getEndToken() && (rt.getEndToken() instanceof com.pullenti.ner.TextToken)) 
                        val = ((com.pullenti.ner.TextToken)com.pullenti.unisharp.Utils.cast(rt.getEndToken(), com.pullenti.ner.TextToken.class)).term;
                    else 
                        val = tt.getReferent().toStringEx(true, tt.kit.baseLanguage, 0).toUpperCase();
                    t1 = tt;
                }
                else if ((tt instanceof com.pullenti.ner.TextToken) && tt.chars.isCapitalUpper()) {
                    com.pullenti.ner.geo.internal.CityItemToken cit = com.pullenti.ner.geo.internal.CityItemToken.tryParse(tt, null, true, null);
                    if (cit != null && cit.orgRef == null && ((cit.typ == com.pullenti.ner.geo.internal.CityItemToken.ItemType.PROPERNAME || cit.typ == com.pullenti.ner.geo.internal.CityItemToken.ItemType.CITY))) {
                        val = (cit.value != null ? cit.value : (cit != null && cit.ontoItem != null ? cit.ontoItem.getCanonicText() : null));
                        t1 = (tt = cit.getEndToken());
                    }
                    else 
                        break;
                }
                else 
                    break;
                if (vals == null) 
                    vals = new java.util.ArrayList<String>();
                if (val.indexOf('-') > 0 && (tt instanceof com.pullenti.ner.TextToken)) 
                    com.pullenti.unisharp.Utils.addToArrayList(vals, java.util.Arrays.asList(com.pullenti.unisharp.Utils.split(val, String.valueOf('-'), false)));
                else 
                    vals.add(val);
                if (tt.getNext() != null && tt.getNext().isHiphen()) 
                    tt = tt.getNext();
                else if (tt.getNext() != null && tt.getNext().isComma() && br) 
                    tt = tt.getNext();
                else 
                    break;
            }
            if (vals != null) {
                boolean ok = false;
                if (vals.size() > 1) 
                    ok = true;
                else if (com.pullenti.ner.geo.internal.MiscLocationHelper.checkGeoObjectBefore(t, false)) 
                    ok = true;
                else {
                    StreetItemToken sit1 = tryParse(t1.getNext(), null, false, null);
                    if (sit1 != null && sit1.typ == StreetItemType.NUMBER && sit1.isNumberKm) 
                        ok = true;
                }
                if (ok) {
                    if (br) {
                        if (com.pullenti.ner.core.BracketHelper.isBracket(t1.getNext(), false)) 
                            t1 = t1.getNext();
                    }
                    res = new java.util.ArrayList<StreetItemToken>();
                    if (prev != null) {
                        prev.nounIsDoubtCoef = 0;
                        prev.isAbridge = false;
                    }
                    res.add((sit = _new305(t, t1, StreetItemType.NAME)));
                    if (vals.size() == 1) 
                        sit.value = vals.get(0);
                    else if (vals.size() == 2) {
                        sit.value = (vals.get(0) + " - " + vals.get(1));
                        sit.altValue = (vals.get(1) + " - " + vals.get(0));
                    }
                    else if (vals.size() == 3) {
                        sit.value = (vals.get(0) + " - " + vals.get(1) + " - " + vals.get(2));
                        sit.altValue = (vals.get(2) + " - " + vals.get(1) + " - " + vals.get(0));
                    }
                    else if (vals.size() == 4) {
                        sit.value = (vals.get(0) + " - " + vals.get(1) + " - " + vals.get(2) + " - " + vals.get(3));
                        sit.altValue = (vals.get(3) + " - " + vals.get(2) + " - " + vals.get(1) + " - " + vals.get(0));
                    }
                    else 
                        return null;
                    return res;
                }
            }
            if (((t instanceof com.pullenti.ner.TextToken) && t.getLengthChar() == 1 && t.chars.isLetter()) && t.getNext() != null) {
                if (t.isValue("К", null) || t.isValue("Д", null)) 
                    return null;
                com.pullenti.ner.Token tt = t.getNext();
                if (tt.isHiphen() && tt.getNext() != null) 
                    tt = tt.getNext();
                if (tt instanceof com.pullenti.ner.NumberToken) {
                    res = new java.util.ArrayList<StreetItemToken>();
                    prev.nounIsDoubtCoef = 0;
                    res.add((sit = _new305(t, tt, StreetItemType.NAME)));
                    char ch = ((com.pullenti.ner.TextToken)com.pullenti.unisharp.Utils.cast(t, com.pullenti.ner.TextToken.class)).term.charAt(0);
                    char ch0 = com.pullenti.morph.LanguageHelper.getCyrForLat(ch);
                    if (((int)ch0) != 0) 
                        ch = ch0;
                    sit.value = (String.valueOf(ch) + ((com.pullenti.ner.NumberToken)com.pullenti.unisharp.Utils.cast(tt, com.pullenti.ner.NumberToken.class)).getValue());
                    sit.isRoadName = true;
                    tt = tt.getNext();
                    if (tt != null && tt.isHiphen() && (tt.getNext() instanceof com.pullenti.ner.NumberToken)) {
                        sit.setEndToken(tt.getNext());
                        tt = tt.getNext().getNext();
                    }
                    com.pullenti.ner.core.BracketSequenceToken br1 = com.pullenti.ner.core.BracketHelper.tryParse(tt, com.pullenti.ner.core.BracketParseAttr.NO, 100);
                    if (br1 != null && (br1.getLengthChar() < 15)) {
                        sit.setEndToken(br1.getEndToken());
                        sit.altValue = com.pullenti.ner.core.MiscHelper.getTextValue(tt.getNext(), sit.getEndToken().getPrevious(), com.pullenti.ner.core.GetTextAttr.NO);
                    }
                    else if (tt != null && tt.getLengthChar() > 2 && !tt.chars.isAllLower()) {
                        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) || tt.isValue("БАЛТИЯ", null)) || tt.isValue("РОССИЯ", null) || tt.isValue("НЕВА", null)) || tt.isValue("КОЛА", null) || tt.isValue("КАСПИЙ", null)) {
                            sit.setEndToken(tt);
                            sit.altValue = com.pullenti.ner.core.MiscHelper.getTextValue(tt, tt, com.pullenti.ner.core.GetTextAttr.NO);
                        }
                        else {
                            java.util.ArrayList<StreetItemToken> nnn = tryParseSpec(tt, prev);
                            if (nnn != null && nnn.size() == 1 && nnn.get(0).typ == StreetItemType.NAME) {
                                sit.setEndToken(nnn.get(0).getEndToken());
                                sit.altValue = nnn.get(0).value;
                                sit.altValue2 = nnn.get(0).altValue;
                            }
                        }
                    }
                    return res;
                }
            }
        }
        if ((t instanceof com.pullenti.ner.TextToken) && t.getLengthChar() == 1 && t.chars.isLetter()) {
            com.pullenti.ner.Token tt2 = t.getNext();
            if (tt2 != null && tt2.isHiphen()) 
                tt2 = tt2.getNext();
            if ((tt2 instanceof com.pullenti.ner.NumberToken) && !tt2.isWhitespaceBefore()) {
                if (prev != null && prev.typ == StreetItemType.NAME) {
                    if (!AddressItemToken.checkHouseAfter(t, false, false)) {
                        res = new java.util.ArrayList<StreetItemToken>();
                        res.add(_new369(t, tt2, StreetItemType.NUMBER, true, ((com.pullenti.ner.NumberToken)com.pullenti.unisharp.Utils.cast(tt2, com.pullenti.ner.NumberToken.class)).getValue()));
                        return res;
                    }
                }
            }
        }
        return null;
    }

    private static StreetItemToken _tryAttachRoadNum(com.pullenti.ner.Token t) {
        if (t == null) 
            return null;
        if (!t.chars.isLetter() || t.getLengthChar() != 1) 
            return null;
        com.pullenti.ner.Token tt = t.getNext();
        if (tt != null && tt.isHiphen()) 
            tt = tt.getNext();
        if (!(tt instanceof com.pullenti.ner.NumberToken)) 
            return null;
        StreetItemToken res = _new305(t, tt, StreetItemType.NAME);
        res.value = (t.getSourceText().toUpperCase() + ((com.pullenti.ner.NumberToken)com.pullenti.unisharp.Utils.cast(tt, com.pullenti.ner.NumberToken.class)).getValue());
        return res;
    }

    public static java.util.ArrayList<StreetItemToken> tryParseList(com.pullenti.ner.Token t, int maxCount, com.pullenti.ner.geo.internal.GeoAnalyzerData ad) {
        if (t == null) 
            return null;
        if (ad == null) 
            ad = com.pullenti.ner.geo.GeoAnalyzer.getData(t);
        if (ad == null) 
            return null;
        if (ad.sLevel > 2) 
            return null;
        ad.sLevel++;
        java.util.ArrayList<StreetItemToken> res = _tryParseList(t, maxCount, ad);
        ad.sLevel--;
        return res;
    }

    private static java.util.ArrayList<StreetItemToken> _tryParseList(com.pullenti.ner.Token t, int maxCount, com.pullenti.ner.geo.internal.GeoAnalyzerData ad) {
        java.util.ArrayList<StreetItemToken> res = null;
        StreetItemToken sit = tryParse(t, null, false, ad);
        if (sit != null) {
            res = new java.util.ArrayList<StreetItemToken>();
            res.add(sit);
            t = sit.getEndToken().getNext();
        }
        else {
            res = tryParseSpec(t, null);
            if (res == null) 
                return null;
            sit = res.get(res.size() - 1);
            t = sit.getEndToken().getNext();
            StreetItemToken sit2 = tryParse(t, null, false, null);
            if (sit2 != null && sit2.typ == StreetItemType.NOUN) {
            }
            else if (AddressItemToken.checkHouseAfter(t, false, true)) {
            }
            else 
                return null;
        }
        for (; t != null; t = (t == null ? null : t.getNext())) {
            if (maxCount > 0 && res.size() >= maxCount) 
                break;
            if (t.isNewlineBefore()) {
                if (t.getNewlinesBeforeCount() > 1) 
                    break;
                if (((t.getWhitespacesAfterCount() < 15) && sit != null && sit.typ == StreetItemType.NOUN) && t.chars.isCapitalUpper()) {
                }
                else {
                    boolean ok = false;
                    if (res.size() == 1 && res.get(0).typ == StreetItemType.NAME) {
                        StreetItemToken sit1 = tryParse(sit.getEndToken().getNext(), sit, false, ad);
                        if (sit1 != null && sit1.typ == StreetItemType.NOUN) {
                            StreetItemToken sit2 = tryParse(sit1.getEndToken().getNext(), sit1, false, ad);
                            if (sit2 == null) 
                                ok = true;
                        }
                    }
                    else if (res.size() == 2 && res.get(0).typ == StreetItemType.NOUN && res.get(1).typ == StreetItemType.STDADJECTIVE) {
                        StreetItemToken sit1 = tryParse(sit.getEndToken().getNext(), sit, false, ad);
                        if (sit1 != null && ((sit1.typ == StreetItemType.STDNAME || sit1.typ == StreetItemType.NAME))) {
                            if (AddressItemToken.checkHouseAfter(sit1.getEndToken().getNext(), false, false)) 
                                ok = true;
                        }
                    }
                    if (!ok) 
                        break;
                }
            }
            if (t.isHiphen() && sit != null && ((sit.typ == StreetItemType.NAME || sit.typ == StreetItemType.STDNAME || (sit.typ == StreetItemType.STDADJECTIVE)))) {
                StreetItemToken sit1 = tryParse(t.getNext(), sit, false, ad);
                if (sit1 == null) {
                    com.pullenti.ner.NumberToken num = com.pullenti.ner.core.NumberHelper.tryParseRoman(t.getNext());
                    if (num != null) {
                        sit = _new299(t, num.getEndToken(), StreetItemType.NUMBER, num.getValue(), true);
                        res.add(sit);
                        t = sit.getEndToken();
                        continue;
                    }
                    break;
                }
                if (sit1.typ == StreetItemType.NUMBER) {
                    com.pullenti.ner.Token tt = sit1.getEndToken().getNext();
                    if (tt != null && tt.isComma()) 
                        tt = tt.getNext();
                    boolean ok = false;
                    AddressItemToken ait = AddressItemToken.tryParsePureItem(tt, null, null);
                    if (ait != null) {
                        if (ait.getTyp() == AddressItemType.HOUSE) 
                            ok = true;
                    }
                    if (!ok) {
                        if (res.size() == 2 && res.get(0).typ == StreetItemType.NOUN) {
                            if (com.pullenti.unisharp.Utils.stringsEq(res.get(0).termin.getCanonicText(), "МИКРОРАЙОН")) 
                                ok = true;
                        }
                    }
                    if (!ok && t.isHiphen()) 
                        ok = true;
                    if (ok) {
                        sit = sit1;
                        res.add(sit);
                        t = sit.getEndToken();
                        sit.numberHasPrefix = true;
                        continue;
                    }
                }
                if (sit1.typ != StreetItemType.NAME && sit1.typ != StreetItemType.NAME) {
                    if (sit1.typ == StreetItemType.NOUN && sit1.nounCanBeName) {
                    }
                    else if (sit1.typ == StreetItemType.STDADJECTIVE) {
                    }
                    else 
                        break;
                }
                if (t.isWhitespaceBefore() && t.isWhitespaceAfter()) 
                    break;
                if (res.get(0).getBeginToken().getPrevious() != null) {
                    AddressItemToken aaa = AddressItemToken.tryParsePureItem(res.get(0).getBeginToken().getPrevious(), null, null);
                    if (aaa != null && aaa.getTyp() == AddressItemType.DETAIL && aaa.detailType == com.pullenti.ner.address.AddressDetailType.CROSS) 
                        break;
                }
                sit = sit1;
                res.add(sit);
                t = sit.getEndToken();
                continue;
            }
            else if (t.isHiphen() && sit != null && sit.typ == StreetItemType.NUMBER) {
                StreetItemToken sit1 = tryParse(t.getNext(), null, false, ad);
                if (sit1 != null && (((sit1.typ == StreetItemType.STDADJECTIVE || sit1.typ == StreetItemType.STDNAME || sit1.typ == StreetItemType.NAME) || sit1.typ == StreetItemType.NOUN))) {
                    sit.numberHasPrefix = true;
                    sit = sit1;
                    res.add(sit);
                    t = sit.getEndToken();
                    continue;
                }
            }
            if (t.isChar('.') && sit != null && sit.typ == StreetItemType.NOUN) {
                if (t.getWhitespacesAfterCount() > 1) 
                    break;
                sit = tryParse(t.getNext(), null, false, ad);
                if (sit == null) 
                    break;
                if (sit.typ == StreetItemType.NUMBER || sit.typ == StreetItemType.STDADJECTIVE) {
                    StreetItemToken sit1 = tryParse(sit.getEndToken().getNext(), null, false, ad);
                    if (sit1 != null && ((sit1.typ == StreetItemType.STDADJECTIVE || sit1.typ == StreetItemType.STDNAME || sit1.typ == StreetItemType.NAME))) {
                    }
                    else if (!com.pullenti.ner.geo.internal.MiscLocationHelper.isUserParamAddress(sit)) 
                        break;
                    else {
                        AddressItemToken ai = AddressItemToken.tryParsePureItem(t.getNext(), null, null);
                        if (ai != null && ai.getTyp() != AddressItemType.NUMBER) 
                            break;
                    }
                }
                else if (sit.typ != StreetItemType.NAME && sit.typ != StreetItemType.STDNAME && sit.typ != StreetItemType.AGE) 
                    break;
                if (t.getPrevious().getMorphClassInDictionary().isNoun()) {
                    if (!sit.isInDictionary) {
                        com.pullenti.ner.Token tt = sit.getEndToken().getNext();
                        boolean hasHouse = false;
                        for (; tt != null; tt = tt.getNext()) {
                            if (tt.isNewlineBefore()) 
                                break;
                            if (tt.isComma()) 
                                continue;
                            AddressItemToken ai = AddressItemToken.tryParsePureItem(tt, null, null);
                            if (ai != null && ((ai.getTyp() == AddressItemType.HOUSE || ai.getTyp() == AddressItemType.BUILDING || ai.getTyp() == AddressItemType.CORPUS))) {
                                hasHouse = true;
                                break;
                            }
                            if (tt instanceof com.pullenti.ner.NumberToken) {
                                hasHouse = true;
                                break;
                            }
                            StreetItemToken vv = tryParse(tt, null, false, ad);
                            if (vv == null || vv.typ == StreetItemType.NOUN) 
                                break;
                            tt = vv.getEndToken();
                        }
                        if (!hasHouse) 
                            break;
                    }
                    if (t.getPrevious().getPrevious() != null) {
                        com.pullenti.ner.core.NounPhraseToken npt11 = com.pullenti.ner.geo.internal.MiscLocationHelper.tryParseNpt(t.getPrevious().getPrevious());
                        if (npt11 != null && npt11.getEndToken() == t.getPrevious()) 
                            break;
                    }
                }
                res.add(sit);
            }
            else {
                sit = tryParse(t, res.get(res.size() - 1), false, ad);
                if (sit == null) {
                    java.util.ArrayList<StreetItemToken> spli = tryParseSpec(t, res.get(res.size() - 1));
                    if (spli != null && spli.size() > 0) {
                        com.pullenti.unisharp.Utils.addToArrayList(res, spli);
                        t = spli.get(spli.size() - 1).getEndToken();
                        continue;
                    }
                    if (((t instanceof com.pullenti.ner.TextToken) && ((res.size() == 2 || res.size() == 3)) && res.get(0).typ == StreetItemType.NOUN) && res.get(1).typ == StreetItemType.NUMBER && (((com.pullenti.unisharp.Utils.stringsEq(((com.pullenti.ner.TextToken)com.pullenti.unisharp.Utils.cast(t, com.pullenti.ner.TextToken.class)).term, "ГОДА") || com.pullenti.unisharp.Utils.stringsEq(((com.pullenti.ner.TextToken)com.pullenti.unisharp.Utils.cast(t, com.pullenti.ner.TextToken.class)).term, "МАЯ") || com.pullenti.unisharp.Utils.stringsEq(((com.pullenti.ner.TextToken)com.pullenti.unisharp.Utils.cast(t, com.pullenti.ner.TextToken.class)).term, "МАРТА")) || com.pullenti.unisharp.Utils.stringsEq(((com.pullenti.ner.TextToken)com.pullenti.unisharp.Utils.cast(t, com.pullenti.ner.TextToken.class)).term, "СЪЕЗДА")))) {
                        res.add((sit = _new285(t, t, StreetItemType.STDNAME, ((com.pullenti.ner.TextToken)com.pullenti.unisharp.Utils.cast(t, com.pullenti.ner.TextToken.class)).term)));
                        continue;
                    }
                    sit = res.get(res.size() - 1);
                    if (t == null) 
                        break;
                    if (sit.typ == StreetItemType.NOUN && ((com.pullenti.unisharp.Utils.stringsEq(sit.termin.getCanonicText(), "МИКРОРАЙОН") || com.pullenti.unisharp.Utils.stringsEq(sit.termin.getCanonicText(), "МІКРОРАЙОН"))) && (t.getWhitespacesBeforeCount() < 2)) {
                        com.pullenti.ner.Token tt1 = t;
                        if (tt1.isHiphen() && tt1.getNext() != null) 
                            tt1 = tt1.getNext();
                        if (com.pullenti.ner.core.BracketHelper.isBracket(tt1, true) && tt1.getNext() != null) 
                            tt1 = tt1.getNext();
                        com.pullenti.ner.Token tt2 = tt1.getNext();
                        boolean br = false;
                        if (com.pullenti.ner.core.BracketHelper.isBracket(tt2, true)) {
                            tt2 = tt2.getNext();
                            br = true;
                        }
                        if (((tt1 instanceof com.pullenti.ner.TextToken) && tt1.getLengthChar() == 1 && tt1.chars.isLetter()) && ((AddressItemToken.checkHouseAfter(tt2, false, true) || tt2 == null))) {
                            sit = _new285(t, (br ? tt1.getNext() : tt1), StreetItemType.NAME, ((com.pullenti.ner.TextToken)com.pullenti.unisharp.Utils.cast(tt1, com.pullenti.ner.TextToken.class)).term);
                            char ch1 = AddressItemToken.correctChar(sit.value.charAt(0));
                            if (((int)ch1) != 0 && ch1 != sit.value.charAt(0)) 
                                sit.altValue = (String.valueOf(ch1));
                            res.add(sit);
                            break;
                        }
                    }
                    if (t.isComma() && (((sit.typ == StreetItemType.NAME || sit.typ == StreetItemType.STDNAME || sit.typ == StreetItemType.STDPARTOFNAME) || sit.typ == StreetItemType.STDADJECTIVE || ((sit.typ == StreetItemType.NUMBER && res.size() > 1 && (((res.get(res.size() - 2).typ == StreetItemType.NAME || res.get(res.size() - 2).typ == StreetItemType.STDNAME || res.get(res.size() - 2).typ == StreetItemType.STDADJECTIVE) || res.get(res.size() - 2).typ == StreetItemType.STDPARTOFNAME))))))) {
                        StreetItemToken sit2 = tryParse(t.getNext(), null, false, ad);
                        if (sit2 != null && sit2.typ == StreetItemType.NOUN) {
                            com.pullenti.ner.Token ttt = sit2.getEndToken().getNext();
                            if (ttt != null && ttt.isComma()) 
                                ttt = ttt.getNext();
                            AddressItemToken add = AddressItemToken.tryParsePureItem(ttt, null, null);
                            if (add != null && ((add.getTyp() == AddressItemType.HOUSE || add.getTyp() == AddressItemType.CORPUS || add.getTyp() == AddressItemType.BUILDING))) {
                                res.add(sit2);
                                t = sit2.getEndToken();
                                continue;
                            }
                        }
                    }
                    else if (t.isComma() && sit.typ == StreetItemType.NOUN && (sit.termin.getCanonicText().indexOf("КВАРТАЛ") >= 0)) {
                        com.pullenti.ner.geo.internal.NumToken num = com.pullenti.ner.geo.internal.NumToken.tryParse(t.getNext(), com.pullenti.ner.geo.internal.GeoTokenType.STREET);
                        if (num != null && num.isCadasterNumber) 
                            continue;
                    }
                    if (com.pullenti.ner.core.BracketHelper.canBeStartOfSequence(t, true, false)) {
                        StreetItemToken sit1 = res.get(res.size() - 1);
                        if (sit1.typ == StreetItemType.NOUN && ((sit1.nounIsDoubtCoef == 0 || (((t.getNext() instanceof com.pullenti.ner.TextToken) && !t.getNext().chars.isAllLower()))))) {
                            com.pullenti.ner.core.BracketSequenceToken br = com.pullenti.ner.core.BracketHelper.tryParse(t, com.pullenti.ner.core.BracketParseAttr.NO, 100);
                            if (br != null && (br.getLengthChar() < 50)) {
                                StreetItemToken sit2 = tryParse(t.getNext(), null, false, ad);
                                if (sit2 != null && sit2.getEndToken().getNext() == br.getEndToken()) {
                                    if (sit2.value == null && sit2.typ == StreetItemType.NAME) 
                                        sit2.value = com.pullenti.ner.core.MiscHelper.getTextValue(sit2.getBeginToken(), sit2.getEndToken(), com.pullenti.ner.core.GetTextAttr.NO);
                                    sit2.setBeginToken(t);
                                    sit2.isInBrackets = true;
                                    t = sit2.setEndToken(br.getEndToken());
                                    res.add(sit2);
                                    continue;
                                }
                                res.add(_new374(t, br.getEndToken(), StreetItemType.NAME, com.pullenti.ner.core.MiscHelper.getTextValue(t, br.getEndToken(), com.pullenti.ner.core.GetTextAttr.NO), true));
                                t = br.getEndToken();
                                continue;
                            }
                        }
                    }
                    if (t.isHiphen() && (t.getNext() instanceof com.pullenti.ner.NumberToken) && ((com.pullenti.ner.NumberToken)com.pullenti.unisharp.Utils.cast(t.getNext(), com.pullenti.ner.NumberToken.class)).getIntValue() != null) {
                        sit = res.get(res.size() - 1);
                        if (sit.typ == StreetItemType.NOUN && (((com.pullenti.unisharp.Utils.stringsEq(sit.termin.getCanonicText(), "КВАРТАЛ") || com.pullenti.unisharp.Utils.stringsEq(sit.termin.getCanonicText(), "МИКРОРАЙОН") || com.pullenti.unisharp.Utils.stringsEq(sit.termin.getCanonicText(), "ГОРОДОК")) || com.pullenti.unisharp.Utils.stringsEq(sit.termin.getCanonicText(), "МІКРОРАЙОН")))) {
                            sit = _new308(t, t.getNext(), StreetItemType.NUMBER, ((com.pullenti.ner.NumberToken)com.pullenti.unisharp.Utils.cast(t.getNext(), com.pullenti.ner.NumberToken.class)).getValue(), ((com.pullenti.ner.NumberToken)com.pullenti.unisharp.Utils.cast(t.getNext(), com.pullenti.ner.NumberToken.class)).typ, true);
                            res.add(sit);
                            t = t.getNext();
                            continue;
                        }
                    }
                    if ((((t.isChar(':') || t.isHiphen())) && res.size() == 1 && res.get(0).typ == StreetItemType.NOUN) && (t.getWhitespacesAfterCount() < 3)) 
                        continue;
                    if ((t.isComma() && res.size() == 1 && res.get(0).typ == StreetItemType.NOUN) && com.pullenti.ner.geo.internal.MiscLocationHelper.isUserParamAddress(t)) {
                        sit = tryParse(t.getNext(), null, false, null);
                        if (sit != null && ((sit.typ == StreetItemType.NAME || sit.typ == StreetItemType.STDNAME || sit.typ == StreetItemType.STDADJECTIVE))) {
                            res.add(sit);
                            t = sit.getEndToken();
                            continue;
                        }
                    }
                    if ((t.isChar('(') && t.getNext() != null && (t.getNext().getReferent() instanceof com.pullenti.ner.geo.GeoReferent)) && t.getNext().getNext() != null && t.getNext().getNext().isChar(')')) {
                        sit = tryParse(t.getNext().getNext().getNext(), null, false, null);
                        if (sit != null && sit.typ == StreetItemType.NOUN) {
                            res.get(res.size() - 1).area = AddressItemToken._new85(AddressItemType.REGION, t, t.getNext().getNext(), t.getNext().getReferent());
                            res.add(sit);
                            t = sit.getEndToken();
                            continue;
                        }
                    }
                    break;
                }
                res.add(sit);
                if (sit.typ == StreetItemType.NAME) {
                    int cou = 0;
                    int jj;
                    for (jj = res.size() - 1; jj >= 0; jj--) {
                        if (res.get(jj).typ == StreetItemType.NAME) 
                            cou++;
                        else 
                            break;
                    }
                    if (cou > 4) {
                        if (jj < 0) 
                            return null;
                        for(int jjj = jj + res.size() - jj - 1, mmm = jj; jjj >= mmm; jjj--) res.remove(jjj);
                        break;
                    }
                    if (res.size() > 1 && res.get(0).typ == StreetItemType.NOUN && res.get(0).isRoad()) {
                        com.pullenti.ner.Token tt = sit.getEndToken().getNext();
                        if (tt != null) {
                            if (tt.isValue("Ш", null) || tt.isValue("ШОССЕ", null) || tt.isValue("ШОС", null)) {
                                sit = sit.clone();
                                com.pullenti.unisharp.Utils.putArrayValue(res, res.size() - 1, sit);
                                sit.setEndToken(tt);
                                if (tt.getNext() != null && tt.getNext().isChar('.') && tt.getLengthChar() <= 3) 
                                    sit.setEndToken(sit.getEndToken().getNext());
                            }
                        }
                    }
                }
            }
            t = sit.getEndToken();
        }
        for (int i = 0; i < (res.size() - 1); i++) {
            if (res.get(i).typ == StreetItemType.NAME && ((res.get(i + 1).altTyp == StreetItemType.STDPARTOFNAME || res.get(i + 1).typ == StreetItemType.STDPARTOFNAME))) {
                StreetItemToken r = res.get(i).clone();
                if (r.value == null) 
                    r.value = com.pullenti.ner.core.MiscHelper.getTextValueOfMetaToken(r, com.pullenti.ner.core.GetTextAttr.NO);
                r.misc = (res.get(i + 1).value != null ? res.get(i + 1).value : com.pullenti.ner.core.MiscHelper.getTextValueOfMetaToken(res.get(i + 1), com.pullenti.ner.core.GetTextAttr.NO));
                r.setEndToken(res.get(i + 1).getEndToken());
                com.pullenti.unisharp.Utils.putArrayValue(res, i, r);
                res.remove(i + 1);
            }
            else if (res.get(i + 1).typ == StreetItemType.NAME && ((res.get(i).altTyp == StreetItemType.STDPARTOFNAME || res.get(i).typ == StreetItemType.STDPARTOFNAME))) {
                StreetItemToken r = res.get(i + 1).clone();
                if (r.value == null) 
                    r.value = com.pullenti.ner.core.MiscHelper.getTextValueOfMetaToken(r, com.pullenti.ner.core.GetTextAttr.NO);
                r.misc = (res.get(i).value != null ? res.get(i).value : com.pullenti.ner.core.MiscHelper.getTextValueOfMetaToken(res.get(i), com.pullenti.ner.core.GetTextAttr.NO));
                r.setBeginToken(res.get(i).getBeginToken());
                com.pullenti.unisharp.Utils.putArrayValue(res, i, r);
                res.remove(i + 1);
            }
        }
        for (int i = 0; i < (res.size() - 1); i++) {
            if (res.get(i).typ == StreetItemType.NAME && res.get(i + 1).typ == StreetItemType.NAME && (res.get(i).getWhitespacesAfterCount() < 3)) {
                boolean isProp = false;
                boolean isPers = false;
                if (res.get(i).getBeginToken().getMorph()._getClass().isNoun()) {
                    com.pullenti.ner.ReferentToken rt = res.get(i).kit.processReferent("PERSON", res.get(i).getBeginToken(), null);
                    if (rt != null) {
                        if (com.pullenti.unisharp.Utils.stringsEq(rt.referent.getTypeName(), "PERSONPROPERTY")) 
                            isProp = true;
                        else if (rt.getEndToken() == res.get(i + 1).getEndToken()) 
                            isPers = true;
                    }
                }
                if ((i == 0 && ((!isProp && !isPers)) && ((i + 2) < res.size())) && res.get(i + 2).typ == StreetItemType.NOUN && !res.get(i).getBeginToken().getMorph()._getClass().isAdjective()) {
                    if (com.pullenti.ner.geo.internal.MiscLocationHelper.checkGeoObjectBefore(res.get(0).getBeginToken(), false) && res.get(0).getEndToken().getNext() == res.get(1).getBeginToken() && (res.get(0).getWhitespacesAfterCount() < 2)) {
                    }
                    else {
                        res.remove(i);
                        i--;
                        continue;
                    }
                }
                if (res.get(i).getMorph()._getClass().isAdjective() && res.get(i + 1).getMorph()._getClass().isAdjective() && !isPers) {
                    if (res.get(i).getEndToken().getNext().isHiphen()) {
                    }
                    else if (i == 1 && res.get(0).typ == StreetItemType.NOUN && res.size() == 3) {
                    }
                    else if (i == 0 && res.size() == 3 && res.get(2).typ == StreetItemType.NOUN) {
                    }
                    else 
                        continue;
                }
                if (res.get(i).chars.value != res.get(i + 1).chars.value) {
                    com.pullenti.ner.ReferentToken rt = res.get(0).kit.processReferent("ORGANIZATION", res.get(i + 1).getBeginToken(), null);
                    if (rt != null) {
                        for(int jjj = i + 1 + res.size() - i - 1 - 1, mmm = i + 1; jjj >= mmm; jjj--) res.remove(jjj);
                        continue;
                    }
                }
                StreetItemToken r = res.get(i).clone();
                if (r.value == null) 
                    r.value = com.pullenti.ner.core.MiscHelper.getTextValueOfMetaToken(res.get(i), com.pullenti.ner.core.GetTextAttr.NO);
                com.pullenti.ner.Token tt1 = res.get(i + 1).getEndToken();
                com.pullenti.morph.MorphClass mc1 = res.get(i).getBeginToken().getMorphClassInDictionary();
                com.pullenti.morph.MorphClass mc2 = tt1.getMorphClassInDictionary();
                if ((tt1.isValue("БОР", null) || tt1.isValue("САД", null) || tt1.isValue("ПАРК", null)) || tt1.getPrevious().isHiphen()) 
                    r.value = com.pullenti.ner.core.MiscHelper.getTextValue(res.get(i).getBeginToken(), res.get(i + 1).getEndToken(), com.pullenti.ner.core.GetTextAttr.NO);
                else if (((mc1.isProperName() && !mc2.isProperName())) || ((!mc1.isProperSurname() && mc2.isProperSurname()))) {
                    if (r.misc == null) 
                        r.misc = r.value;
                    r.value = (res.get(i + 1).value != null ? res.get(i + 1).value : com.pullenti.ner.core.MiscHelper.getTextValueOfMetaToken(res.get(i + 1), com.pullenti.ner.core.GetTextAttr.NO));
                }
                else if (((mc2.isProperName() && !mc1.isProperName())) || ((!mc2.isProperSurname() && mc1.isProperSurname()))) {
                    if (r.misc == null) 
                        r.misc = com.pullenti.ner.core.MiscHelper.getTextValueOfMetaToken(res.get(i + 1), com.pullenti.ner.core.GetTextAttr.NO);
                }
                else 
                    r.value = com.pullenti.ner.core.MiscHelper.getTextValue(res.get(i).getBeginToken(), res.get(i + 1).getEndToken(), com.pullenti.ner.core.GetTextAttr.NO);
                if ((r.value.indexOf("-") >= 0)) 
                    r.value = r.value.replace('-', ' ');
                r.ortoTerr = res.get(i + 1).ortoTerr;
                r.setEndToken(res.get(i + 1).getEndToken());
                r.existStreet = null;
                r.isInDictionary = res.get(i + 1).isInDictionary || res.get(i).isInDictionary;
                com.pullenti.unisharp.Utils.putArrayValue(res, i, r);
                res.remove(i + 1);
                i--;
            }
        }
        for (int i = 0; i < (res.size() - 1); i++) {
            if (res.get(i).typ == StreetItemType.STDADJECTIVE && res.get(i).getEndToken().isChar('.') && res.get(i + 1)._isSurname()) {
                StreetItemToken r = res.get(i + 1).clone();
                r.value = ((com.pullenti.ner.TextToken)com.pullenti.unisharp.Utils.cast(res.get(i + 1).getBeginToken(), com.pullenti.ner.TextToken.class)).term;
                r.altValue = com.pullenti.ner.core.MiscHelper.getTextValue(res.get(i).getBeginToken(), res.get(i + 1).getEndToken(), com.pullenti.ner.core.GetTextAttr.NO);
                r.setBeginToken(res.get(i).getBeginToken());
                r.stdAdjVersion = res.get(i);
                com.pullenti.unisharp.Utils.putArrayValue(res, i + 1, r);
                res.remove(i);
                break;
            }
        }
        for (int i = 0; i < (res.size() - 1); i++) {
            if ((res.get(i + 1).typ == StreetItemType.STDADJECTIVE && res.get(i + 1).getEndToken().isChar('.') && res.get(i + 1).getBeginToken().getLengthChar() == 1) && !res.get(i).getBeginToken().chars.isAllLower()) {
                if (res.get(i)._isSurname()) {
                    if (i == (res.size() - 2) || res.get(i + 2).typ != StreetItemType.NOUN) {
                        StreetItemToken r = res.get(i).clone();
                        if (r.value == null) 
                            r.value = com.pullenti.ner.core.MiscHelper.getTextValueOfMetaToken(r, com.pullenti.ner.core.GetTextAttr.NO);
                        r.setEndToken(res.get(i + 1).getEndToken());
                        r.stdAdjVersion = res.get(i + 1);
                        com.pullenti.unisharp.Utils.putArrayValue(res, i, r);
                        res.remove(i + 1);
                        break;
                    }
                }
            }
        }
        for (int i = 0; i < (res.size() - 1); i++) {
            if (res.get(i).typ == StreetItemType.NAME || res.get(i).typ == StreetItemType.STDNAME || res.get(i).typ == StreetItemType.STDADJECTIVE) {
                if (res.get(i + 1).typ == StreetItemType.NOUN && !res.get(i + 1).isAbridge && com.pullenti.unisharp.Utils.stringsNe(res.get(i + 1).termin.getCanonicText(), "УЛИЦА")) {
                    java.util.ArrayList<StreetItemToken> res0 = new java.util.ArrayList<StreetItemToken>(res);
                    for(int jjj = 0 + i + 1 - 1, mmm = 0; jjj >= mmm; jjj--) res0.remove(jjj);
                    AddressItemToken rtt = StreetDefineHelper.tryParseStreet(res0, false, false, false, null, false);
                    if (rtt != null) 
                        continue;
                    int i0 = -1;
                    if (i == 1 && res.get(0).typ == StreetItemType.NOUN && res.size() == 3) 
                        i0 = 0;
                    else if (i == 0 && res.size() == 3 && res.get(2).typ == StreetItemType.NOUN) 
                        i0 = 2;
                    if (i0 < 0) 
                        continue;
                    if (res.get(i0).termin == res.get(i + 1).termin) 
                        continue;
                    StreetItemToken r = res.get(i).clone();
                    r.altValue = (res.get(i).value != null ? res.get(i).value : com.pullenti.ner.core.MiscHelper.getTextValue(res.get(i).getBeginToken(), res.get(i).getEndToken(), com.pullenti.ner.core.GetTextAttr.NO));
                    if (res.get(i).typ == StreetItemType.STDADJECTIVE) {
                        java.util.ArrayList<String> adjs = com.pullenti.ner.geo.internal.MiscLocationHelper.getStdAdjFull(res.get(i).getBeginToken(), res.get(i + 1).getMorph().getGender(), res.get(i + 1).getMorph().getNumber(), true);
                        if (adjs != null && adjs.size() > 0) 
                            r.altValue = adjs.get(0);
                    }
                    r.value = (r.altValue + " " + res.get(i + 1).termin.getCanonicText());
                    r.typ = StreetItemType.STDNAME;
                    r.setEndToken(res.get(i + 1).getEndToken());
                    com.pullenti.unisharp.Utils.putArrayValue(res, i, r);
                    StreetItemToken rr = res.get(i0).clone();
                    rr.altTermin = res.get(i + 1).termin;
                    com.pullenti.unisharp.Utils.putArrayValue(res, i0, rr);
                    res.remove(i + 1);
                    i--;
                }
            }
        }
        if ((res.size() >= 3 && res.get(0).typ == StreetItemType.NOUN && com.pullenti.unisharp.Utils.stringsEq(res.get(0).termin.getCanonicText(), "КВАРТАЛ")) && ((res.get(1).typ == StreetItemType.NAME || res.get(1).typ == StreetItemType.STDNAME)) && res.get(2).typ == StreetItemType.NOUN) {
            if (res.size() == 3 || res.get(3).typ == StreetItemType.NUMBER) {
                java.util.ArrayList<StreetItemToken> res0 = new java.util.ArrayList<StreetItemToken>(res);
                for(int jjj = 0 + 2 - 1, mmm = 0; jjj >= mmm; jjj--) res0.remove(jjj);
                AddressItemToken rtt = StreetDefineHelper.tryParseStreet(res0, false, false, false, null, false);
                if (rtt == null || res0.get(0).chars.isCapitalUpper()) {
                    StreetItemToken r = res.get(1).clone();
                    r.value = (com.pullenti.ner.core.MiscHelper.getTextValueOfMetaToken(res.get(1), com.pullenti.ner.core.GetTextAttr.NO) + " " + res.get(2).termin.getCanonicText());
                    r.setEndToken(res.get(2).getEndToken());
                    com.pullenti.unisharp.Utils.putArrayValue(res, 1, r);
                    res.remove(2);
                }
            }
        }
        if ((res.size() >= 3 && res.get(0).typ == StreetItemType.NOUN && com.pullenti.unisharp.Utils.stringsEq(res.get(0).termin.getCanonicText(), "КВАРТАЛ")) && ((res.get(2).typ == StreetItemType.NAME || res.get(2).typ == StreetItemType.STDNAME)) && res.get(1).typ == StreetItemType.NOUN) {
            if (res.size() == 3 || res.get(3).typ == StreetItemType.NUMBER) {
                StreetItemToken r = res.get(1).clone();
                r.value = (com.pullenti.ner.core.MiscHelper.getTextValueOfMetaToken(res.get(2), com.pullenti.ner.core.GetTextAttr.NO) + " " + res.get(1).termin.getCanonicText());
                r.setEndToken(res.get(2).getEndToken());
                r.typ = StreetItemType.NAME;
                com.pullenti.unisharp.Utils.putArrayValue(res, 1, r);
                res.remove(2);
            }
        }
        if ((res.size() >= 3 && res.get(0).typ == StreetItemType.NUMBER && !res.get(0).isNumberKm) && res.get(1).typ == StreetItemType.NOUN) {
            if (!com.pullenti.ner.geo.internal.MiscLocationHelper.isUserParamAddress(res.get(0)) && res.get(2).typ != StreetItemType.STDNAME && res.get(2).typ != StreetItemType.FIX) {
                com.pullenti.ner.NumberToken nt = (com.pullenti.ner.NumberToken)com.pullenti.unisharp.Utils.cast(res.get(0).getBeginToken(), com.pullenti.ner.NumberToken.class);
                if (nt != null && nt.typ == com.pullenti.ner.NumberSpellingType.DIGIT && nt.getMorph()._getClass().isUndefined()) 
                    return null;
            }
        }
        int ii0 = -1;
        int ii1 = -1;
        if (res.size() > 0 && res.get(0).typ == StreetItemType.NOUN && res.get(0).isRoad()) {
            ii0 = (ii1 = 0);
            if (((ii0 + 1) < res.size()) && res.get(ii0 + 1).typ == StreetItemType.NUMBER && res.get(ii0 + 1).isNumberKm) 
                ii0++;
        }
        else if ((res.size() > 1 && res.get(0).typ == StreetItemType.NUMBER && res.get(0).isNumberKm) && res.get(1).typ == StreetItemType.NOUN && res.get(1).isRoad()) 
            ii0 = (ii1 = 1);
        if (ii0 >= 0) {
            if (res.size() == (ii0 + 1)) {
                com.pullenti.ner.Token tt = res.get(ii0).getEndToken().getNext();
                StreetItemToken num = _tryAttachRoadNum(tt);
                if (num != null) {
                    res.add(num);
                    tt = num.getEndToken().getNext();
                    res.get(0).isAbridge = false;
                }
                if (tt != null && (tt.getReferent() instanceof com.pullenti.ner.geo.GeoReferent)) {
                    com.pullenti.ner.geo.GeoReferent g1 = (com.pullenti.ner.geo.GeoReferent)com.pullenti.unisharp.Utils.cast(tt.getReferent(), com.pullenti.ner.geo.GeoReferent.class);
                    tt = tt.getNext();
                    if (tt != null && tt.isHiphen()) 
                        tt = tt.getNext();
                    com.pullenti.ner.geo.GeoReferent g2 = (tt == null ? null : (com.pullenti.ner.geo.GeoReferent)com.pullenti.unisharp.Utils.cast(tt.getReferent(), com.pullenti.ner.geo.GeoReferent.class));
                    if (g2 != null) {
                        if (g1.isCity() && g2.isCity()) {
                            StreetItemToken nam = _new305(res.get(0).getEndToken().getNext(), tt, StreetItemType.NAME);
                            nam.value = (g1.toStringEx(true, tt.kit.baseLanguage, 0) + " - " + g2.toStringEx(true, tt.kit.baseLanguage, 0)).toUpperCase();
                            nam.altValue = (g2.toStringEx(true, tt.kit.baseLanguage, 0) + " - " + g1.toStringEx(true, tt.kit.baseLanguage, 0)).toUpperCase();
                            res.add(nam);
                        }
                    }
                }
                else if (com.pullenti.ner.core.BracketHelper.isBracket(tt, false)) {
                    com.pullenti.ner.core.BracketSequenceToken br = com.pullenti.ner.core.BracketHelper.tryParse(tt, com.pullenti.ner.core.BracketParseAttr.NO, 100);
                    if (br != null) {
                        StreetItemToken nam = _new378(tt, br.getEndToken(), StreetItemType.NAME, true);
                        nam.value = com.pullenti.ner.core.MiscHelper.getTextValue(tt.getNext(), br.getEndToken(), com.pullenti.ner.core.GetTextAttr.NO);
                        res.add(nam);
                    }
                }
            }
            else if ((res.size() == (ii0 + 2) && res.get(ii0 + 1).typ == StreetItemType.NAME && res.get(ii0 + 1).getEndToken().getNext() != null) && res.get(ii0 + 1).getEndToken().getNext().isHiphen()) {
                com.pullenti.ner.Token tt = res.get(ii0 + 1).getEndToken().getNext().getNext();
                com.pullenti.ner.geo.GeoReferent g2 = (tt == null ? null : (com.pullenti.ner.geo.GeoReferent)com.pullenti.unisharp.Utils.cast(tt.getReferent(), com.pullenti.ner.geo.GeoReferent.class));
                com.pullenti.ner.Token te = null;
                String name2 = null;
                if (g2 == null && tt != null) {
                    com.pullenti.ner.ReferentToken rt = tt.kit.processReferent("GEO", tt, null);
                    if (rt != null) {
                        te = rt.getEndToken();
                        name2 = rt.referent.toStringEx(true, te.kit.baseLanguage, 0);
                    }
                    else {
                        java.util.ArrayList<com.pullenti.ner.geo.internal.CityItemToken> cits2 = com.pullenti.ner.geo.internal.CityItemToken.tryParseList(tt, 2, null);
                        if (cits2 != null) {
                            if (cits2.size() == 1 && ((cits2.get(0).typ == com.pullenti.ner.geo.internal.CityItemToken.ItemType.PROPERNAME || cits2.get(0).typ == com.pullenti.ner.geo.internal.CityItemToken.ItemType.CITY))) {
                                if (cits2.get(0).ontoItem != null) 
                                    name2 = cits2.get(0).ontoItem.getCanonicText();
                                else 
                                    name2 = cits2.get(0).value;
                                te = cits2.get(0).getEndToken();
                            }
                        }
                    }
                }
                else if (g2 != null) {
                    te = tt;
                    name2 = g2.toStringEx(true, te.kit.baseLanguage, 0);
                }
                if (((g2 != null && g2.isCity())) || ((g2 == null && name2 != null))) {
                    StreetItemToken r = res.get(ii0 + 1).clone();
                    r.altValue = (name2 + " - " + ((res.get(ii0 + 1).value != null ? res.get(ii0 + 1).value : res.get(ii0 + 1).getSourceText()))).toUpperCase();
                    r.value = (((res.get(ii0 + 1).value != null ? res.get(ii0 + 1).value : res.get(ii0 + 1).getSourceText())) + " - " + name2).toUpperCase();
                    r.setEndToken(te);
                    com.pullenti.unisharp.Utils.putArrayValue(res, ii0 + 1, r);
                }
            }
            StreetItemToken nn = _tryAttachRoadNum(res.get(res.size() - 1).getEndToken().getNext());
            if (nn != null) {
                res.add(nn);
                res.get(ii1).isAbridge = false;
            }
            if (res.size() > (ii0 + 1) && res.get(ii0 + 1).typ == StreetItemType.NAME && com.pullenti.unisharp.Utils.stringsEq(res.get(ii1).termin.getCanonicText(), "АВТОДОРОГА")) {
                if (res.get(ii0 + 1).getBeginToken().isValue("ФЕДЕРАЛЬНЫЙ", null)) 
                    return null;
                com.pullenti.ner.core.NounPhraseToken npt = com.pullenti.ner.geo.internal.MiscLocationHelper.tryParseNpt(res.get(ii0 + 1).getBeginToken());
                if (npt != null && npt.adjectives.size() > 0) {
                    if (npt.getEndToken().isValue("ЗНАЧЕНИЕ", null)) 
                        return null;
                }
            }
        }
        while (res.size() > 1) {
            StreetItemToken it = res.get(res.size() - 1);
            if (it.getBeginToken() == it.getEndToken() && it.getLengthChar() == 1 && it.isValue("В", null)) {
                if (it.getEndToken().getNext() instanceof com.pullenti.ner.ReferentToken) {
                    res.remove(it);
                    continue;
                }
            }
            if (res.size() == 4) {
                if ((res.get(0).typ == StreetItemType.NOUN && res.get(1).typ == StreetItemType.NUMBER && res.get(2).typ == StreetItemType.NOUN) && res.get(3).typ == StreetItemType.NUMBER) 
                    break;
            }
            if (res.size() == 5) {
                if (((res.get(0).typ == StreetItemType.NOUN && com.pullenti.unisharp.Utils.stringsEq(res.get(0).termin.getCanonicText(), "УЛИЦА") && res.get(1).typ == StreetItemType.NOUN) && res.get(2).typ == StreetItemType.NUMBER && res.get(3).typ == StreetItemType.NOUN) && res.get(4).typ == StreetItemType.NUMBER) 
                    break;
            }
            StreetItemToken it0 = (res.size() > 1 ? res.get(res.size() - 2) : null);
            if (it.typ == StreetItemType.NUMBER && !it.numberHasPrefix && !it.isNumberKm) {
                if (it.getBeginToken() instanceof com.pullenti.ner.NumberToken) {
                    if (res.size() == 2 && res.get(0).typ == StreetItemType.NOUN) 
                        break;
                    if (com.pullenti.ner.geo.internal.MiscLocationHelper.isUserParamGarAddress(res.get(0))) 
                        break;
                    if (!it.getBeginToken().getMorph()._getClass().isAdjective() || it.getBeginToken().getMorph()._getClass().isNoun()) {
                        if (AddressItemToken.checkHouseAfter(it.getEndToken().getNext(), false, true)) 
                            it.numberHasPrefix = true;
                        else if (it0 != null && it0.typ == StreetItemType.NOUN && (((com.pullenti.unisharp.Utils.stringsEq(it0.termin.getCanonicText(), "МИКРОРАЙОН") || com.pullenti.unisharp.Utils.stringsEq(it0.termin.getCanonicText(), "МІКРОРАЙОН") || com.pullenti.unisharp.Utils.stringsEq(it0.termin.getCanonicText(), "КВАРТАЛ")) || com.pullenti.unisharp.Utils.stringsEq(it0.termin.getCanonicText(), "ГОРОДОК")))) {
                            AddressItemToken ait = AddressItemToken.tryParsePureItem(it.getBeginToken(), null, null);
                            if (ait != null && ait.getTyp() == AddressItemType.NUMBER && ait.getEndChar() > it.getEndChar()) {
                                it.numberType = com.pullenti.ner.NumberSpellingType.UNDEFINED;
                                it.value = ait.value;
                                it.setEndToken(ait.getEndToken());
                                it.typ = StreetItemType.NAME;
                            }
                        }
                        else if (it0 != null && it0.termin != null && com.pullenti.unisharp.Utils.stringsEq(it0.termin.getCanonicText(), "ПОЧТОВОЕ ОТДЕЛЕНИЕ")) 
                            it.numberHasPrefix = true;
                        else if (it0 != null && it0.getBeginToken().isValue("ЛИНИЯ", null)) 
                            it.numberHasPrefix = true;
                        else if (res.size() == 2 && res.get(0).typ == StreetItemType.NOUN && (res.get(0).getWhitespacesAfterCount() < 2)) {
                        }
                        else if (it.getBeginToken().getMorph()._getClass().isAdjective() && ((com.pullenti.ner.NumberToken)com.pullenti.unisharp.Utils.cast(it.getBeginToken(), com.pullenti.ner.NumberToken.class)).typ == com.pullenti.ner.NumberSpellingType.WORDS && it.getBeginToken().chars.isCapitalUpper()) 
                            it.numberHasPrefix = true;
                        else if (it.getBeginToken().getPrevious().isHiphen()) 
                            it.numberHasPrefix = true;
                        else if (((res.size() > 1 && res.get(res.size() - 2).typ == StreetItemType.NAME && res.get(res.size() - 2).getBeginToken() == res.get(res.size() - 2).getEndToken()) && it.getBeginToken().getPrevious().getMorphClassInDictionary().isProperName() && (it.getBeginToken() instanceof com.pullenti.ner.NumberToken)) && ((com.pullenti.ner.NumberToken)com.pullenti.unisharp.Utils.cast(it.getBeginToken(), com.pullenti.ner.NumberToken.class)).getIntValue() != null && (((com.pullenti.ner.NumberToken)com.pullenti.unisharp.Utils.cast(it.getBeginToken(), com.pullenti.ner.NumberToken.class)).getIntValue() < 3)) 
                            it.numberHasPrefix = true;
                        else {
                            res.remove(res.size() - 1);
                            continue;
                        }
                    }
                    else 
                        it.numberHasPrefix = true;
                }
            }
            break;
        }
        if (res.size() == 0) 
            return null;
        for (int i = 0; i < res.size(); i++) {
            if (res.get(i).nextItem != null) {
                if (res.get(i).typ == StreetItemType.NUMBER && i > 0 && res.get(i - 1).typ == StreetItemType.NAME) {
                }
                else 
                    res.add(i + 1, res.get(i).nextItem);
            }
        }
        for (int i = 0; i < res.size(); i++) {
            if ((res.get(i).typ == StreetItemType.NOUN && res.get(i).chars.isCapitalUpper() && (((com.pullenti.unisharp.Utils.stringsEq(res.get(i).termin.getCanonicText(), "НАБЕРЕЖНАЯ") || com.pullenti.unisharp.Utils.stringsEq(res.get(i).termin.getCanonicText(), "МИКРОРАЙОН") || com.pullenti.unisharp.Utils.stringsEq(res.get(i).termin.getCanonicText(), "НАБЕРЕЖНА")) || com.pullenti.unisharp.Utils.stringsEq(res.get(i).termin.getCanonicText(), "МІКРОРАЙОН") || com.pullenti.unisharp.Utils.stringsEq(res.get(i).termin.getCanonicText(), "ГОРОДОК")))) && res.get(i).getBeginToken().isValue(res.get(i).termin.getCanonicText(), null)) {
                boolean ok = false;
                if (i > 0 && ((res.get(i - 1).typ == StreetItemType.NOUN || res.get(i - 1).typ == StreetItemType.STDADJECTIVE))) 
                    ok = true;
                else if (i > 1 && ((res.get(i - 1).typ == StreetItemType.STDADJECTIVE || res.get(i - 1).typ == StreetItemType.NUMBER)) && res.get(i - 2).typ == StreetItemType.NOUN) 
                    ok = true;
                if (ok) {
                    StreetItemToken r = res.get(i).clone();
                    r.typ = StreetItemType.NAME;
                    com.pullenti.unisharp.Utils.putArrayValue(res, i, r);
                }
            }
        }
        StreetItemToken last = res.get(res.size() - 1);
        for (int kk = 0; kk < 2; kk++) {
            com.pullenti.ner.Token ttt = last.getEndToken().getNext();
            if (((last.typ == StreetItemType.NAME && ttt != null && ttt.getLengthChar() == 1) && ttt.chars.isAllUpper() && (ttt.getWhitespacesBeforeCount() < 2)) && ttt.getNext() != null && ttt.getNext().isChar('.')) {
                if (AddressItemToken.tryParsePureItem(ttt, null, null) != null) 
                    break;
                last = last.clone();
                last.setEndToken(ttt.getNext());
                com.pullenti.unisharp.Utils.putArrayValue(res, res.size() - 1, last);
            }
        }
        if (res.size() > 1) {
            if (res.get(res.size() - 1)._org != null) {
                if (res.size() == 2 && res.get(0).typ == StreetItemType.NOUN) {
                }
                else 
                    res.remove(res.size() - 1);
            }
        }
        if (res.size() == 2 && res.get(0).typ == StreetItemType.NOUN && res.get(1).typ == StreetItemType.NOUN) {
            if (!res.get(1).chars.isAllLower() && !res.get(1).isAbridge && res.get(1).getBeginToken() == res.get(1).getEndToken()) {
                com.pullenti.unisharp.Utils.putArrayValue(res, 1, res.get(1).clone());
                res.get(1).typ = StreetItemType.NAME;
                res.get(1).value = com.pullenti.ner.core.MiscHelper.getTextValueOfMetaToken(res.get(1), com.pullenti.ner.core.GetTextAttr.NO);
            }
        }
        if (res.size() == 0) 
            return null;
        return res;
    }

    public static void initialize() {
        if (m_Ontology != null) 
            return;
        m_Ontology = new com.pullenti.ner.core.TerminCollection();
        m_OntologyEx = new com.pullenti.ner.core.TerminCollection();
        m_StdOntMisc = new com.pullenti.ner.core.TerminCollection();
        m_StdAdj = new com.pullenti.ner.core.TerminCollection();
        com.pullenti.ner.core.Termin t;
        t = com.pullenti.ner.core.Termin._new379("УЛИЦА", StreetItemType.NOUN, com.pullenti.morph.MorphGender.FEMINIE);
        t.addAbridge("УЛ.");
        t.addAbridge("УЛЮ");
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new380("ВУЛИЦЯ", StreetItemType.NOUN, com.pullenti.morph.MorphLang.UA, com.pullenti.morph.MorphGender.FEMINIE);
        t.addAbridge("ВУЛ.");
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new96("STREET", StreetItemType.NOUN);
        t.addAbridge("ST.");
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new382("ПЛОЩАДЬ", StreetItemType.NOUN, 1, com.pullenti.morph.MorphGender.FEMINIE);
        t.addAbridge("ПЛ.");
        t.addAbridge("ПЛОЩ.");
        t.addAbridge("ПЛ-ДЬ");
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new383("ПЛОЩА", StreetItemType.NOUN, com.pullenti.morph.MorphLang.UA, 1, com.pullenti.morph.MorphGender.FEMINIE);
        t.addAbridge("ПЛ.");
        t.addAbridge("ПЛОЩ.");
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new382("МАЙДАН", StreetItemType.NOUN, 0, com.pullenti.morph.MorphGender.MASCULINE);
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new96("SQUARE", StreetItemType.NOUN);
        t.addAbridge("SQ.");
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new382("ПРОЕЗД", StreetItemType.NOUN, 1, com.pullenti.morph.MorphGender.MASCULINE);
        t.addAbridge("ПР.");
        t.addAbridge("П-Д");
        t.addAbridge("ПР-Д");
        t.addAbridge("ПР-ЗД");
        t.addAbridge("ПД");
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new383("ПРОЕЗД", StreetItemType.NOUN, com.pullenti.morph.MorphLang.UA, 1, com.pullenti.morph.MorphGender.MASCULINE);
        t.addAbridge("ПР.");
        t.addAbridge("П-Д");
        t.addAbridge("ПР-Д");
        t.addAbridge("ПР-ЗД");
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new382("ЛИНИЯ", StreetItemType.NOUN, 2, com.pullenti.morph.MorphGender.FEMINIE);
        t.addAbridge("ЛИН.");
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new383("ЛІНІЯ", StreetItemType.NOUN, com.pullenti.morph.MorphLang.UA, 2, com.pullenti.morph.MorphGender.FEMINIE);
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new382("РЯД", StreetItemType.NOUN, 2, com.pullenti.morph.MorphGender.MASCULINE);
        m_Ontology.add(t);
        m_Block = (t = com.pullenti.ner.core.Termin._new382("БЛОК", StreetItemType.NOUN, 2, com.pullenti.morph.MorphGender.MASCULINE));
        t.addAbridge("БЛ.");
        t.addVariant("БЛОК ГАРАЖЕЙ", false);
        t.addVariant("ГАРАЖНЫЙ БЛОК", false);
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new382("ПАНЕЛЬ", StreetItemType.NOUN, 2, com.pullenti.morph.MorphGender.FEMINIE);
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new382("КУСТ", StreetItemType.NOUN, 2, com.pullenti.morph.MorphGender.MASCULINE);
        t.addVariant("КУСТ ГАЗОВЫХ СКВАЖИН", false);
        t.addVariant("КУСТОВАЯ ПЛОЩАДКА СКВАЖИН", false);
        t.addVariant("КУСТ СКВАЖИН", false);
        m_Ontology.add(t);
        m_Prospect = (t = com.pullenti.ner.core.Termin._new382("ПРОСПЕКТ", StreetItemType.NOUN, 0, com.pullenti.morph.MorphGender.MASCULINE));
        t.addAbridge("ПРОС.");
        t.addAbridge("ПРКТ");
        t.addAbridge("ПРОСП.");
        t.addAbridge("ПР-Т");
        t.addAbridge("ПР-КТ");
        t.addAbridge("П-Т");
        t.addAbridge("П-КТ");
        t.addAbridge("ПР Т");
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new382("ПЕРЕУЛОК", StreetItemType.NOUN, 0, com.pullenti.morph.MorphGender.MASCULINE);
        t.addAbridge("ПЕР.");
        t.addAbridge("ПЕР-К");
        t.addAbridge("П-К");
        t.addVariant("ПРЕУЛОК", false);
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new382("ПРОУЛОК", StreetItemType.NOUN, 0, com.pullenti.morph.MorphGender.MASCULINE);
        t.addAbridge("ПРОУЛ.");
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new383("ПРОВУЛОК", StreetItemType.NOUN, com.pullenti.morph.MorphLang.UA, 0, com.pullenti.morph.MorphGender.MASCULINE);
        t.addAbridge("ПРОВ.");
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new98("LANE", StreetItemType.NOUN, 0);
        t.addAbridge("LN.");
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new382("ТУПИК", StreetItemType.NOUN, 1, com.pullenti.morph.MorphGender.MASCULINE);
        t.addAbridge("ТУП.");
        t.addAbridge("Т.");
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new382("БУЛЬВАР", StreetItemType.NOUN, 0, com.pullenti.morph.MorphGender.MASCULINE);
        t.addAbridge("БУЛЬВ.");
        t.addAbridge("БУЛ.");
        t.addAbridge("Б-Р");
        t.addAbridge("Б-РЕ");
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new98("BOULEVARD", StreetItemType.NOUN, 0);
        t.addAbridge("BLVD");
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new98("СКВЕР", StreetItemType.NOUN, 1);
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new382("НАБЕРЕЖНАЯ", StreetItemType.NOUN, 0, com.pullenti.morph.MorphGender.FEMINIE);
        t.addAbridge("НАБ.");
        t.addAbridge("НАБЕР.");
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new383("НАБЕРЕЖНА", StreetItemType.NOUN, com.pullenti.morph.MorphLang.UA, 0, com.pullenti.morph.MorphGender.FEMINIE);
        t.addAbridge("НАБ.");
        t.addAbridge("НАБЕР.");
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new382("АЛЛЕЯ", StreetItemType.NOUN, 0, com.pullenti.morph.MorphGender.FEMINIE);
        t.addAbridge("АЛ.");
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new383("АЛЕЯ", StreetItemType.NOUN, com.pullenti.morph.MorphLang.UA, 0, com.pullenti.morph.MorphGender.FEMINIE);
        t.addAbridge("АЛ.");
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new98("ALLEY", StreetItemType.NOUN, 0);
        t.addAbridge("ALY.");
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new382("АВЕНЮ", StreetItemType.NOUN, 0, com.pullenti.morph.MorphGender.FEMINIE);
        t.addVariant("АВЕНЬЮ", false);
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new382("ПРОСЕКА", StreetItemType.NOUN, 1, com.pullenti.morph.MorphGender.FEMINIE);
        t.addVariant("ПРОСЕК", false);
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new382("ПЛОЩАДКА", StreetItemType.NOUN, 1, com.pullenti.morph.MorphGender.FEMINIE);
        t.addAbridge("ПЛ-КА");
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new383("ПРОСІКА", StreetItemType.NOUN, com.pullenti.morph.MorphLang.UA, 1, com.pullenti.morph.MorphGender.FEMINIE);
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new382("ТРАКТ", StreetItemType.NOUN, 1, com.pullenti.morph.MorphGender.NEUTER);
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new382("ШОССЕ", StreetItemType.NOUN, 1, com.pullenti.morph.MorphGender.NEUTER);
        t.addAbridge("Ш.");
        t.addAbridge("ШОС.");
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new383("ШОСЕ", StreetItemType.NOUN, com.pullenti.morph.MorphLang.UA, 1, com.pullenti.morph.MorphGender.NEUTER);
        t.addAbridge("Ш.");
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new98("ROAD", StreetItemType.NOUN, 1);
        t.addAbridge("RD.");
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new382("МИКРОРАЙОН", StreetItemType.NOUN, 0, com.pullenti.morph.MorphGender.MASCULINE);
        t.addAbridge("МКР.");
        t.addAbridge("МКН.");
        t.addAbridge("МИКР-Н");
        t.addAbridge("МИКР.");
        t.addAbridge("МКР-Н");
        t.addAbridge("МКР-ОН");
        t.addAbridge("МКРН.");
        t.addAbridge("М-Н");
        t.addAbridge("М-ОН");
        t.addAbridge("М.Р-Н");
        t.addAbridge("МИКР-ОН");
        t.addVariant("МИКРОН", false);
        t.addAbridge("М/Р");
        t.addVariant("МІКРОРАЙОН", false);
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new382("КВАРТАЛ", StreetItemType.NOUN, 2, com.pullenti.morph.MorphGender.MASCULINE);
        t.addAbridge("КВАРТ.");
        t.addAbridge("КВ-Л");
        t.addAbridge("КВ.");
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new382("КАДАСТРОВЫЙ КВАРТАЛ", StreetItemType.NOUN, 2, com.pullenti.morph.MorphGender.MASCULINE);
        t.addAbridge("КАД.КВАРТ.");
        t.addAbridge("КАД.КВ-Л");
        t.addAbridge("КАД.КВ.");
        t.addAbridge("КАД.КВАРТАЛ");
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new382("ТОРФЯНОЙ УЧАСТОК", StreetItemType.NOUN, 2, com.pullenti.morph.MorphGender.MASCULINE);
        t.addVariant("ТОРФУЧАСТОК", false);
        t.addVariant("ТОРФОУЧАСТОК", false);
        t.addAbridge("ТОРФ.УЧАСТОК");
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new382("МОСТ", StreetItemType.NOUN, 2, com.pullenti.morph.MorphGender.MASCULINE);
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new383("МІСТ", StreetItemType.NOUN, com.pullenti.morph.MorphLang.UA, 2, com.pullenti.morph.MorphGender.MASCULINE);
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new98("PLAZA", StreetItemType.NOUN, 1);
        t.addAbridge("PLZ");
        m_Ontology.add(t);
        m_Metro = (t = com.pullenti.ner.core.Termin._new423("СТАНЦИЯ МЕТРО", "МЕТРО", StreetItemType.NOUN, 0, com.pullenti.morph.MorphGender.FEMINIE));
        t.addVariant("СТАНЦІЯ МЕТРО", false);
        t.addAbridge("СТ.МЕТРО");
        t.addAbridge("СТ.М.");
        t.addAbridge("МЕТРО");
        m_Ontology.add(t);
        m_Road = (t = com.pullenti.ner.core.Termin._new424("АВТОДОРОГА", StreetItemType.NOUN, "ФАД", 0, com.pullenti.morph.MorphGender.FEMINIE));
        t.addVariant("ФЕДЕРАЛЬНАЯ АВТОДОРОГА", false);
        t.addVariant("АВТОМОБИЛЬНАЯ ДОРОГА", false);
        t.addVariant("АВТОТРАССА", false);
        t.addVariant("ФЕДЕРАЛЬНАЯ ТРАССА", false);
        t.addVariant("ФЕДЕР ТРАССА", false);
        t.addVariant("АВТОМАГИСТРАЛЬ", false);
        t.addAbridge("А/Д");
        t.addAbridge("ФЕДЕР.ТРАССА");
        t.addAbridge("ФЕД.ТРАССА");
        t.addVariant("ГОСТРАССА", false);
        t.addVariant("ГОС.ТРАССА", false);
        t.addVariant("АВТОМАГ", false);
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new423("ДОРОГА", "АВТОДОРОГА", StreetItemType.NOUN, 1, com.pullenti.morph.MorphGender.FEMINIE);
        t.addVariant("ТРАССА", false);
        t.addAbridge("ДОР.");
        t.addVariant("ДОР", false);
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new382("МАГИСТРАЛЬ", StreetItemType.NOUN, 1, com.pullenti.morph.MorphGender.FEMINIE);
        t.addVariant("МГСТР", false);
        t.addAbridge("МАГ-ЛЬ");
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new383("АВТОДОРОГА", StreetItemType.NOUN, com.pullenti.morph.MorphLang.UA, 0, com.pullenti.morph.MorphGender.FEMINIE);
        t.addVariant("ФЕДЕРАЛЬНА АВТОДОРОГА", false);
        t.addVariant("АВТОМОБІЛЬНА ДОРОГА", false);
        t.addVariant("АВТОТРАСА", false);
        t.addVariant("ФЕДЕРАЛЬНА ТРАСА", false);
        t.addVariant("АВТОМАГІСТРАЛЬ", false);
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new428("ДОРОГА", "АВТОДОРОГА", StreetItemType.NOUN, com.pullenti.morph.MorphLang.UA, 1, com.pullenti.morph.MorphGender.FEMINIE);
        t.addVariant("ТРАСА", false);
        t.addVariant("МАГІСТРАЛЬ", false);
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new383("МАГІСТРАЛЬ", StreetItemType.NOUN, com.pullenti.morph.MorphLang.UA, 1, com.pullenti.morph.MorphGender.FEMINIE);
        t.addVariant("МГСТР", false);
        t.addAbridge("МАГ-ЛЬ");
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new430("МОСКОВСКАЯ КОЛЬЦЕВАЯ АВТОМОБИЛЬНАЯ ДОРОГА", "МКАД", StreetItemType.FIX, com.pullenti.morph.MorphGender.FEMINIE);
        t.addVariant("МОСКОВСКАЯ КОЛЬЦЕВАЯ АВТОДОРОГА", false);
        m_Ontology.add(t);
        m_Ontology.add(com.pullenti.ner.core.Termin._new96("САДОВОЕ КОЛЬЦО", StreetItemType.FIX));
        m_Ontology.add(com.pullenti.ner.core.Termin._new96("БУЛЬВАРНОЕ КОЛЬЦО", StreetItemType.FIX));
        m_Ontology.add(com.pullenti.ner.core.Termin._new96("ТРАНСПОРТНОЕ КОЛЬЦО", StreetItemType.FIX));
        t = com.pullenti.ner.core.Termin._new434("ПОЧТОВОЕ ОТДЕЛЕНИЕ", StreetItemType.NOUN, "ОПС", com.pullenti.morph.MorphGender.NEUTER);
        t.addAbridge("П.О.");
        t.addAbridge("ПОЧТ.ОТД.");
        t.addAbridge("ПОЧТОВ.ОТД.");
        t.addAbridge("ПОЧТОВОЕ ОТД.");
        t.addAbridge("П/О");
        t.addVariant("ОТДЕЛЕНИЕ ПОЧТОВОЙ СВЯЗИ", false);
        t.addVariant("ПОЧТАМТ", false);
        t.addVariant("ГЛАВПОЧТАМТ", false);
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new379("БУДКА", StreetItemType.NOUN, com.pullenti.morph.MorphGender.FEMINIE);
        t.addVariant("ЖЕЛЕЗНОДОРОЖНАЯ БУДКА", false);
        t.addAbridge("Ж/Д БУДКА");
        t.addAbridge("ЖЕЛ.ДОР.БУДКА");
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new379("КАЗАРМА", StreetItemType.NOUN, com.pullenti.morph.MorphGender.FEMINIE);
        t.addVariant("ЖЕЛЕЗНОДОРОЖНАЯ КАЗАРМА", false);
        t.addAbridge("Ж/Д КАЗАРМА");
        t.addAbridge("ЖЕЛ.ДОР.КАЗАРМА");
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new379("СТОЯНКА", StreetItemType.NOUN, com.pullenti.morph.MorphGender.FEMINIE);
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new379("ПУНКТ", StreetItemType.NOUN, com.pullenti.morph.MorphGender.MASCULINE);
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new379("РАЗЪЕЗД", StreetItemType.NOUN, com.pullenti.morph.MorphGender.MASCULINE);
        t.addAbridge("РЗД");
        t.addAbridge("Ж/Д РАЗЪЕЗД");
        t.addVariant("ЖЕЛЕЗНОДОРОЖНЫЙ РАЗЪЕЗД", false);
        t.addAbridge("ЖЕЛ.ДОР.РАЗЪЕЗД");
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new379("ЗАЕЗД", StreetItemType.NOUN, com.pullenti.morph.MorphGender.MASCULINE);
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new379("ПЕРЕЕЗД", StreetItemType.NOUN, com.pullenti.morph.MorphGender.MASCULINE);
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new96("БОЛЬШОЙ", StreetItemType.STDADJECTIVE);
        t.addAbridge("БОЛ.");
        t.addAbridge("Б.");
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new96("ВЕЛИКИЙ", StreetItemType.STDADJECTIVE);
        t.addAbridge("ВЕЛ.");
        t.addAbridge("В.");
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new96("МАЛЫЙ", StreetItemType.STDADJECTIVE);
        t.addAbridge("МАЛ.");
        t.addAbridge("М.");
        t.addVariant("МАЛИЙ", false);
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new96("СРЕДНИЙ", StreetItemType.STDADJECTIVE);
        t.addAbridge("СРЕД.");
        t.addAbridge("СР.");
        t.addAbridge("С.");
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new97("СЕРЕДНІЙ", StreetItemType.STDADJECTIVE, com.pullenti.morph.MorphLang.UA);
        t.addAbridge("СЕРЕД.");
        t.addAbridge("СЕР.");
        t.addAbridge("С.");
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new96("ВЕРХНИЙ", StreetItemType.STDADJECTIVE);
        t.addAbridge("ВЕРХН.");
        t.addAbridge("ВЕРХ.");
        t.addAbridge("ВЕР.");
        t.addAbridge("В.");
        t.addVariant("ВЕРХНІЙ", false);
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new96("НИЖНИЙ", StreetItemType.STDADJECTIVE);
        t.addAbridge("НИЖН.");
        t.addAbridge("НИЖ.");
        t.addAbridge("Н.");
        t.addVariant("НИЖНІЙ", false);
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new96("СТАРЫЙ", StreetItemType.STDADJECTIVE);
        t.addAbridge("СТАР.");
        t.addAbridge("СТ.");
        t.addVariant("СТАРИЙ", false);
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new96("НОВЫЙ", StreetItemType.STDADJECTIVE);
        t.addAbridge("НОВ.");
        t.addAbridge("Н.");
        t.addVariant("НОВИЙ", false);
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new96("КРАСНЫЙ", StreetItemType.STDADJECTIVE);
        t.addAbridge("КРАСН.");
        t.addAbridge("КР.");
        t.addAbridge("КРАС.");
        t.addVariant("ЧЕРВОНИЙ", false);
        m_Ontology.add(t);
        t = com.pullenti.ner.core.Termin._new96("НОМЕР", StreetItemType.STDADJECTIVE);
        t.addAbridge("N");
        t.addAbridge("№");
        t.addAbridge("НОМ.");
        m_Ontology.add(t);
        for (String s : new String[] {"ПРОЕКТИРУЕМЫЙ", "МИРА", "СВОБОДЫ"}) {
            String[] pp = com.pullenti.unisharp.Utils.split(s, String.valueOf(';'), false);
            t = com.pullenti.ner.core.Termin._new148(pp[0], StreetItemType.STDNAME, true);
            for (int kk = 1; kk < pp.length; kk++) {
                if (pp[kk].indexOf('.') > 0) 
                    t.addAbridge(pp[kk]);
                else 
                    t.addVariant(pp[kk], false);
            }
            m_Ontology.add(t);
        }
        for (String s : com.pullenti.ner.geo.internal.NameToken.standardNames) {
            String[] pp = com.pullenti.unisharp.Utils.split(s, String.valueOf(';'), false);
            t = com.pullenti.ner.core.Termin._new148(pp[0], StreetItemType.STDNAME, true);
            for (int kk = 1; kk < pp.length; kk++) {
                if (pp[kk].indexOf('.') > 0 || pp[kk].indexOf('/') > 0 || pp[kk].indexOf('-') > 0) 
                    t.addAbridge(pp[kk]);
                else if (t.acronym == null && (pp[kk].length() < 4)) 
                    t.acronym = pp[kk];
                else 
                    t.addVariant(pp[kk], false);
            }
            m_Ontology.add(t);
        }
        for (String s : new String[] {"МАРТА", "МАЯ", "ОКТЯБРЯ", "НОЯБРЯ", "БЕРЕЗНЯ", "ТРАВНЯ", "ЖОВТНЯ", "ЛИСТОПАДА", "ДОРОЖКА", "ЛУЧ", "НАДЕЛ", "ПОЛЕ", "СКЛОН"}) {
            m_Ontology.add(com.pullenti.ner.core.Termin._new96(s, StreetItemType.STDNAME));
        }
        for (String s : new String[] {"МАРШАЛА", "ГЕНЕРАЛА", "ГЕНЕРАЛ-МАЙОРА", "ГЕНЕРАЛ-ЛЕЙТЕНАНТА", "ГЕНЕРАЛ-ПОЛКОВНИКА", "АДМИРАЛА", "КОНТРАДМИРАЛА", "КОСМОНАВТА", "ЛЕТЧИКА", "ЛЕТЧИКА-ИСПЫТАТЕЛЯ", "ПИЛОТА", "ПОГРАНИЧНИКА", "ПУТЕШЕСТВЕННИКА", "ПАРТИЗАНА", "АТАМАНА", "ВОЕВОДЫ", "ТАНКИСТА", "ОРУЖЕЙНИКА", "ПОЛЯРНИКА", "АВИАКОНСТРУКТОРА", "АРХИТЕКТОРА", "ГЛАВНОГО АРХИТЕКТОРА", "СКУЛЬПТОРА", "ХУДОЖНИКА", "КОНСТРУКТОРА", "ГЛАВНОГО КОНСТРУКТОРА", "АКАДЕМИКА", "ПРОФЕССОРА", "КОМПОЗИТОРА", "ПИСАТЕЛЯ", "ПОЭТА", "ДИРИЖЕРА", "ГЕРОЯ", "БРАТЬЕВ", "ЛЕЙТЕНАНТА", "СТАРШЕГО ЛЕЙТЕНАНТА", "КАПИТАНА", "КАПИТАНА-ЛЕЙТЕНАНТА", "МАЙОРА", "ПОДПОЛКОВНИКА", "ПОЛКОВНИКА", "СЕРЖАНТА", "МЛАДШЕГО СЕРЖАНТА", "СТАРШЕГО СЕРЖАНТА", "ЕФРЕЙТОРА", "СТАРШИНЫ", "ПРАПОРЩИКА", "СТАРШЕГО ПРАПОРЩИКА", "ПОЛИТРУКА", "МИТРОПОЛИТА", "ПАТРИАРХА", "ИЕРЕЯ", "ПРОТОИЕРЕЯ", "МОНАХА", "СВЯТОГО", "СВЯТИТЕЛЯ", "ШЕЙХА", "БАЛЕРИНЫ", "ПЕВИЦЫ", "ХИРУРГА", "НАРОДНОГО АРТИСТА"}) {
            m_StdOntMisc.add(new com.pullenti.ner.core.Termin(s, null, false));
            t = com.pullenti.ner.core.Termin._new96(s, StreetItemType.STDPARTOFNAME);
            if (com.pullenti.unisharp.Utils.stringsEq(s, "СВЯТОГО") || com.pullenti.unisharp.Utils.stringsEq(s, "СВЯТИТЕЛЯ")) {
                t.addAbridge("СВ.");
                t.addAbridge("СВЯТ.");
            }
            else {
                t.addAllAbridges(0, 0, 2);
                t.addAllAbridges(2, 5, 0);
                if (com.pullenti.unisharp.Utils.stringsEq(s, "ПРОФЕССОРА")) 
                    t.addVariant("ПРОФЕСОРА", false);
            }
            m_Ontology.add(t);
        }
        for (String s : new String[] {"МАРШАЛА", "ГЕНЕРАЛА", "ГЕНЕРАЛ-МАЙОРА", "ГЕНЕРАЛ-ЛЕЙТЕНАНТА", "ГЕНЕРАЛ-ПОЛКОВНИКА", "АДМІРАЛА", "КОНТРАДМІРАЛА", "КОСМОНАВТА", "ЛЬОТЧИКА", " ПРИКОРДОННИКА", " МАНДРІВНИКА", "ПАРТИЗАНА", "ОТАМАНА", "ТАНКІСТА", "АВІАКОНСТРУКТОРА", "АРХІТЕКТОРА", "СКУЛЬПТОРА", "ХУДОЖНИКА", "КОНСТРУКТОРА", "АКАДЕМІКА", "ПРОФЕСОРА", "КОМПОЗИТОРА", "ПИСЬМЕННИКА", "ПОЕТА", "ДИРИГЕНТА", "ГЕРОЯ", "ЛЕЙТЕНАНТА", "КАПІТАНА", "КАПІТАНА-ЛЕЙТЕНАНТА", "МАЙОРА", "ПІДПОЛКОВНИКА", "ПОЛКОВНИКА", "СЕРЖАНТА", "ЄФРЕЙТОРА", " СТАРШИНИ", " ПРАПОРЩИКА", "ПОЛІТРУКА", "ПОЛІЦІЇ", "МІЛІЦІЇ", "ГВАРДІЇ", "АРМІЇ", "МИТРОПОЛИТА", "ПАТРІАРХА", "ІЄРЕЯ", "ПРОТОІЄРЕЯ", "ЧЕНЦЯ", "СВЯТОГО", "СВЯТИТЕЛЯ"}) {
            m_StdOntMisc.add(new com.pullenti.ner.core.Termin(s, null, false));
            t = com.pullenti.ner.core.Termin._new97(s, StreetItemType.STDPARTOFNAME, com.pullenti.morph.MorphLang.UA);
            if (com.pullenti.unisharp.Utils.stringsEq(s, "СВЯТОГО") || com.pullenti.unisharp.Utils.stringsEq(s, "СВЯТИТЕЛЯ")) {
                t.addAbridge("СВ.");
                t.addAbridge("СВЯТ.");
            }
            else {
                t.addAllAbridges(0, 0, 2);
                t.addAllAbridges(2, 5, 0);
                t.addAbridge("ГЛ." + s);
                t.addAbridge("ГЛАВ." + s);
            }
            m_Ontology.add(t);
        }
        t = com.pullenti.ner.core.Termin._new96("ЛЕНИНСКИЕ ГОРЫ", StreetItemType.FIX);
        m_Ontology.add(t);
        for (String s : new String[] {"КРАСНЫЙ", "СОВЕТСТКИЙ", "ЛЕНИНСКИЙ"}) {
            m_StdAdj.add(new com.pullenti.ner.core.Termin(s, null, false));
        }
        for (String s : new String[] {"НЕТ", "НЕ УКАЗАНА", "НЕ ЗАДАНА", "ОТСУТСТВУЕТ"}) {
            m_Ontology.add(com.pullenti.ner.core.Termin._new96(s, StreetItemType.ABSENT));
        }
        m_MiscNouns = new com.pullenti.ner.core.TerminCollection();
        for (String s : new String[] {"ВАЛ", "ПОЛЕ", "СПУСК", "ВЗВОЗ", "РЯД", "СЛОБОДА", "РОЩА", "ПРУД", "СЪЕЗД", "КОЛЬЦО", "УЗВІЗ", "УЗВІЗ", "ГАЙ", "СТАВОК", "ЗЇЗД", "КІЛЬЦЕ"}) {
            m_MiscNouns.add(new com.pullenti.ner.core.Termin(s, null, false));
        }
    }

    public static com.pullenti.ner.Token checkStdName(com.pullenti.ner.Token t) {
        if (t == null) 
            return null;
        if (m_StdAdj.tryParse(t, com.pullenti.ner.core.TerminParseAttr.NO) != null) 
            return t;
        com.pullenti.ner.core.TerminToken tok = m_Ontology.tryParse(t, com.pullenti.ner.core.TerminParseAttr.NO);
        if (tok == null) 
            return null;
        if (((StreetItemType)tok.termin.tag) == StreetItemType.STDNAME) 
            return tok.getEndToken();
        return null;
    }

    public static boolean checkKeyword(com.pullenti.ner.Token t) {
        if (t == null) 
            return false;
        com.pullenti.ner.core.TerminToken tok = m_Ontology.tryParse(t, com.pullenti.ner.core.TerminParseAttr.NO);
        if (tok == null) 
            return false;
        return ((StreetItemType)tok.termin.tag) == StreetItemType.NOUN;
    }

    public static boolean checkOnto(com.pullenti.ner.Token t) {
        if (t == null) 
            return false;
        com.pullenti.ner.core.TerminToken tok = m_OntologyEx.tryParse(t, com.pullenti.ner.core.TerminParseAttr.NO);
        if (tok == null) 
            return false;
        return true;
    }

    public static com.pullenti.ner.core.TerminCollection m_Ontology;

    public static com.pullenti.ner.core.TerminCollection m_OntologyEx;

    private static com.pullenti.ner.core.TerminCollection m_StdOntMisc;

    private static com.pullenti.ner.core.TerminCollection m_StdAdj;

    private static com.pullenti.ner.core.TerminCollection m_MiscNouns;

    private static com.pullenti.ner.core.Termin m_Prospect;

    private static com.pullenti.ner.core.Termin m_Metro;

    private static com.pullenti.ner.core.Termin m_Road;

    private static com.pullenti.ner.core.Termin m_Block;

    private static String[] m_RegTails;

    public static boolean _isRegion(String txt) {
        txt = txt.toUpperCase();
        for (String v : m_RegTails) {
            if (com.pullenti.morph.LanguageHelper.endsWith(txt, v)) 
                return true;
        }
        return false;
    }

    private static String[] m_SpecTails;

    public static boolean _isSpec(String txt) {
        txt = txt.toUpperCase();
        for (String v : m_SpecTails) {
            if (com.pullenti.morph.LanguageHelper.endsWith(txt, v)) 
                return true;
        }
        return false;
    }

    public static StreetItemToken _new86(com.pullenti.ner.Token _arg1, com.pullenti.ner.Token _arg2, StreetItemType _arg3, com.pullenti.ner.geo.internal.OrgItemToken _arg4) {
        StreetItemToken res = new StreetItemToken(_arg1, _arg2);
        res.typ = _arg3;
        res._org = _arg4;
        return res;
    }

    public static StreetItemToken _new285(com.pullenti.ner.Token _arg1, com.pullenti.ner.Token _arg2, StreetItemType _arg3, String _arg4) {
        StreetItemToken res = new StreetItemToken(_arg1, _arg2);
        res.typ = _arg3;
        res.value = _arg4;
        return res;
    }

    public static StreetItemToken _new296(com.pullenti.ner.Token _arg1, com.pullenti.ner.Token _arg2, StreetItemType _arg3, com.pullenti.ner.core.Termin _arg4) {
        StreetItemToken res = new StreetItemToken(_arg1, _arg2);
        res.typ = _arg3;
        res.termin = _arg4;
        return res;
    }

    public static StreetItemToken _new299(com.pullenti.ner.Token _arg1, com.pullenti.ner.Token _arg2, StreetItemType _arg3, String _arg4, boolean _arg5) {
        StreetItemToken res = new StreetItemToken(_arg1, _arg2);
        res.typ = _arg3;
        res.value = _arg4;
        res.numberHasPrefix = _arg5;
        return res;
    }

    public static StreetItemToken _new302(com.pullenti.ner.Token _arg1, com.pullenti.ner.Token _arg2, StreetItemType _arg3, com.pullenti.ner.geo.GeoReferent _arg4) {
        StreetItemToken res = new StreetItemToken(_arg1, _arg2);
        res.typ = _arg3;
        res.city = _arg4;
        return res;
    }

    public static StreetItemToken _new303(com.pullenti.ner.Token _arg1, com.pullenti.ner.Token _arg2, String _arg3, StreetItemType _arg4, boolean _arg5) {
        StreetItemToken res = new StreetItemToken(_arg1, _arg2);
        res.value = _arg3;
        res.typ = _arg4;
        res.numberHasPrefix = _arg5;
        return res;
    }

    public static StreetItemToken _new305(com.pullenti.ner.Token _arg1, com.pullenti.ner.Token _arg2, StreetItemType _arg3) {
        StreetItemToken res = new StreetItemToken(_arg1, _arg2);
        res.typ = _arg3;
        return res;
    }

    public static StreetItemToken _new306(com.pullenti.ner.Token _arg1, com.pullenti.ner.Token _arg2, StreetItemType _arg3, String _arg4, com.pullenti.ner.NumberSpellingType _arg5) {
        StreetItemToken res = new StreetItemToken(_arg1, _arg2);
        res.typ = _arg3;
        res.value = _arg4;
        res.numberType = _arg5;
        return res;
    }

    public static StreetItemToken _new307(com.pullenti.ner.Token _arg1, com.pullenti.ner.Token _arg2, StreetItemType _arg3, String _arg4, com.pullenti.ner.NumberSpellingType _arg5, com.pullenti.ner.MorphCollection _arg6) {
        StreetItemToken res = new StreetItemToken(_arg1, _arg2);
        res.typ = _arg3;
        res.value = _arg4;
        res.numberType = _arg5;
        res.setMorph(_arg6);
        return res;
    }

    public static StreetItemToken _new308(com.pullenti.ner.Token _arg1, com.pullenti.ner.Token _arg2, StreetItemType _arg3, String _arg4, com.pullenti.ner.NumberSpellingType _arg5, boolean _arg6) {
        StreetItemToken res = new StreetItemToken(_arg1, _arg2);
        res.typ = _arg3;
        res.value = _arg4;
        res.numberType = _arg5;
        res.numberHasPrefix = _arg6;
        return res;
    }

    public static StreetItemToken _new310(com.pullenti.ner.Token _arg1, com.pullenti.ner.Token _arg2, boolean _arg3) {
        StreetItemToken res = new StreetItemToken(_arg1, _arg2);
        res.hasStdSuffix = _arg3;
        return res;
    }

    public static StreetItemToken _new311(com.pullenti.ner.Token _arg1, com.pullenti.ner.Token _arg2, com.pullenti.ner.core.Termin _arg3, StreetItemType _arg4) {
        StreetItemToken res = new StreetItemToken(_arg1, _arg2);
        res.termin = _arg3;
        res.typ = _arg4;
        return res;
    }

    public static StreetItemToken _new312(com.pullenti.ner.Token _arg1, com.pullenti.ner.Token _arg2, com.pullenti.ner.core.Termin _arg3, StreetItemType _arg4, boolean _arg5) {
        StreetItemToken res = new StreetItemToken(_arg1, _arg2);
        res.termin = _arg3;
        res.typ = _arg4;
        res.isAbridge = _arg5;
        return res;
    }

    public static StreetItemToken _new313(com.pullenti.ner.Token _arg1, com.pullenti.ner.Token _arg2, StreetItemType _arg3, com.pullenti.ner.address.StreetReferent _arg4, com.pullenti.ner.MorphCollection _arg5, boolean _arg6) {
        StreetItemToken res = new StreetItemToken(_arg1, _arg2);
        res.typ = _arg3;
        res.existStreet = _arg4;
        res.setMorph(_arg5);
        res.isInDictionary = _arg6;
        return res;
    }

    public static StreetItemToken _new316(com.pullenti.ner.Token _arg1, com.pullenti.ner.Token _arg2, StreetItemType _arg3, String _arg4, com.pullenti.ner.NumberSpellingType _arg5, boolean _arg6, com.pullenti.ner.MorphCollection _arg7) {
        StreetItemToken res = new StreetItemToken(_arg1, _arg2);
        res.typ = _arg3;
        res.value = _arg4;
        res.numberType = _arg5;
        res.numberHasPrefix = _arg6;
        res.setMorph(_arg7);
        return res;
    }

    public static StreetItemToken _new318(com.pullenti.ner.Token _arg1, com.pullenti.ner.Token _arg2, StreetItemType _arg3, com.pullenti.ner.core.Termin _arg4, boolean _arg5, com.pullenti.ner.MorphCollection _arg6) {
        StreetItemToken res = new StreetItemToken(_arg1, _arg2);
        res.typ = _arg3;
        res.termin = _arg4;
        res.isAbridge = _arg5;
        res.setMorph(_arg6);
        return res;
    }

    public static StreetItemToken _new321(com.pullenti.ner.Token _arg1, com.pullenti.ner.Token _arg2, StreetItemType _arg3, com.pullenti.ner.core.Termin _arg4, com.pullenti.ner.core.Termin _arg5, boolean _arg6, com.pullenti.ner.MorphCollection _arg7, int _arg8) {
        StreetItemToken res = new StreetItemToken(_arg1, _arg2);
        res.typ = _arg3;
        res.termin = _arg4;
        res.altTermin = _arg5;
        res.isAbridge = _arg6;
        res.setMorph(_arg7);
        res.nounIsDoubtCoef = _arg8;
        return res;
    }

    public static StreetItemToken _new322(com.pullenti.ner.Token _arg1, com.pullenti.ner.Token _arg2, StreetItemType _arg3, com.pullenti.ner.MorphCollection _arg4, String _arg5) {
        StreetItemToken res = new StreetItemToken(_arg1, _arg2);
        res.typ = _arg3;
        res.setMorph(_arg4);
        res.value = _arg5;
        return res;
    }

    public static StreetItemToken _new324(com.pullenti.ner.Token _arg1, com.pullenti.ner.Token _arg2, StreetItemType _arg3, com.pullenti.ner.MorphCollection _arg4, com.pullenti.ner.core.Termin _arg5) {
        StreetItemToken res = new StreetItemToken(_arg1, _arg2);
        res.typ = _arg3;
        res.setMorph(_arg4);
        res.termin = _arg5;
        return res;
    }

    public static StreetItemToken _new326(com.pullenti.ner.Token _arg1, com.pullenti.ner.Token _arg2, StreetItemType _arg3, StreetItemType _arg4, com.pullenti.ner.MorphCollection _arg5, String _arg6) {
        StreetItemToken res = new StreetItemToken(_arg1, _arg2);
        res.typ = _arg3;
        res.altTyp = _arg4;
        res.setMorph(_arg5);
        res.value = _arg6;
        return res;
    }

    public static StreetItemToken _new327(com.pullenti.ner.Token _arg1, com.pullenti.ner.Token _arg2, StreetItemType _arg3, StreetItemType _arg4, com.pullenti.ner.MorphCollection _arg5, com.pullenti.ner.core.Termin _arg6) {
        StreetItemToken res = new StreetItemToken(_arg1, _arg2);
        res.typ = _arg3;
        res.altTyp = _arg4;
        res.setMorph(_arg5);
        res.termin = _arg6;
        return res;
    }

    public static StreetItemToken _new328(com.pullenti.ner.Token _arg1, com.pullenti.ner.Token _arg2, StreetItemType _arg3, com.pullenti.ner.MorphCollection _arg4, boolean _arg5) {
        StreetItemToken res = new StreetItemToken(_arg1, _arg2);
        res.typ = _arg3;
        res.setMorph(_arg4);
        res.isInDictionary = _arg5;
        return res;
    }

    public static StreetItemToken _new329(com.pullenti.ner.Token _arg1, com.pullenti.ner.Token _arg2, StreetItemType _arg3, com.pullenti.ner.MorphCollection _arg4, boolean _arg5, com.pullenti.ner.core.Termin _arg6) {
        StreetItemToken res = new StreetItemToken(_arg1, _arg2);
        res.typ = _arg3;
        res.setMorph(_arg4);
        res.isInDictionary = _arg5;
        res.termin = _arg6;
        return res;
    }

    public static StreetItemToken _new332(com.pullenti.ner.Token _arg1, com.pullenti.ner.Token _arg2, StreetItemType _arg3, com.pullenti.ner.MorphCollection _arg4, String _arg5, String _arg6) {
        StreetItemToken res = new StreetItemToken(_arg1, _arg2);
        res.typ = _arg3;
        res.setMorph(_arg4);
        res.misc = _arg5;
        res.value = _arg6;
        return res;
    }

    public static StreetItemToken _new334(com.pullenti.ner.Token _arg1, com.pullenti.ner.Token _arg2, StreetItemType _arg3, boolean _arg4, String _arg5, com.pullenti.ner.MorphCollection _arg6) {
        StreetItemToken res = new StreetItemToken(_arg1, _arg2);
        res.typ = _arg3;
        res.isInDictionary = _arg4;
        res.value = _arg5;
        res.setMorph(_arg6);
        return res;
    }

    public static StreetItemToken _new336(com.pullenti.ner.Token _arg1, com.pullenti.ner.Token _arg2, StreetItemType _arg3, com.pullenti.ner.core.Termin _arg4, boolean _arg5) {
        StreetItemToken res = new StreetItemToken(_arg1, _arg2);
        res.typ = _arg3;
        res.termin = _arg4;
        res.isAbridge = _arg5;
        return res;
    }

    public static StreetItemToken _new337(com.pullenti.ner.Token _arg1, com.pullenti.ner.Token _arg2, StreetItemType _arg3, boolean _arg4) {
        StreetItemToken res = new StreetItemToken(_arg1, _arg2);
        res.typ = _arg3;
        res.isRoadName = _arg4;
        return res;
    }

    public static StreetItemToken _new338(com.pullenti.ner.Token _arg1, com.pullenti.ner.Token _arg2, StreetItemType _arg3, String _arg4, boolean _arg5) {
        StreetItemToken res = new StreetItemToken(_arg1, _arg2);
        res.typ = _arg3;
        res.value = _arg4;
        res.noGeoInThisToken = _arg5;
        return res;
    }

    public static StreetItemToken _new340(com.pullenti.ner.Token _arg1, com.pullenti.ner.Token _arg2, StreetItemType _arg3, com.pullenti.ner.NumberSpellingType _arg4, String _arg5) {
        StreetItemToken res = new StreetItemToken(_arg1, _arg2);
        res.typ = _arg3;
        res.numberType = _arg4;
        res.value = _arg5;
        return res;
    }

    public static StreetItemToken _new344(com.pullenti.ner.Token _arg1, com.pullenti.ner.Token _arg2, StreetItemType _arg3, com.pullenti.ner.MorphCollection _arg4, com.pullenti.ner.geo.internal.Condition _arg5) {
        StreetItemToken res = new StreetItemToken(_arg1, _arg2);
        res.typ = _arg3;
        res.setMorph(_arg4);
        res.cond = _arg5;
        return res;
    }

    public static StreetItemToken _new347(com.pullenti.ner.Token _arg1, com.pullenti.ner.Token _arg2, StreetItemType _arg3, com.pullenti.ner.NumberSpellingType _arg4, String _arg5, boolean _arg6) {
        StreetItemToken res = new StreetItemToken(_arg1, _arg2);
        res.typ = _arg3;
        res.numberType = _arg4;
        res.value = _arg5;
        res.numberHasPrefix = _arg6;
        return res;
    }

    public static StreetItemToken _new359(com.pullenti.ner.Token _arg1, com.pullenti.ner.Token _arg2, StreetItemType _arg3, boolean _arg4, com.pullenti.ner.NumberSpellingType _arg5, String _arg6) {
        StreetItemToken res = new StreetItemToken(_arg1, _arg2);
        res.typ = _arg3;
        res.numberHasPrefix = _arg4;
        res.numberType = _arg5;
        res.value = _arg6;
        return res;
    }

    public static StreetItemToken _new363(com.pullenti.ner.Token _arg1, com.pullenti.ner.Token _arg2, StreetItemType _arg3, String _arg4, String _arg5) {
        StreetItemToken res = new StreetItemToken(_arg1, _arg2);
        res.typ = _arg3;
        res.value = _arg4;
        res.altValue = _arg5;
        return res;
    }

    public static StreetItemToken _new369(com.pullenti.ner.Token _arg1, com.pullenti.ner.Token _arg2, StreetItemType _arg3, boolean _arg4, String _arg5) {
        StreetItemToken res = new StreetItemToken(_arg1, _arg2);
        res.typ = _arg3;
        res.numberHasPrefix = _arg4;
        res.value = _arg5;
        return res;
    }

    public static StreetItemToken _new374(com.pullenti.ner.Token _arg1, com.pullenti.ner.Token _arg2, StreetItemType _arg3, String _arg4, boolean _arg5) {
        StreetItemToken res = new StreetItemToken(_arg1, _arg2);
        res.typ = _arg3;
        res.value = _arg4;
        res.isInBrackets = _arg5;
        return res;
    }

    public static StreetItemToken _new378(com.pullenti.ner.Token _arg1, com.pullenti.ner.Token _arg2, StreetItemType _arg3, boolean _arg4) {
        StreetItemToken res = new StreetItemToken(_arg1, _arg2);
        res.typ = _arg3;
        res.isInBrackets = _arg4;
        return res;
    }

    public static StreetItemToken _new1585(com.pullenti.ner.Token _arg1, com.pullenti.ner.Token _arg2, StreetItemType _arg3, boolean _arg4) {
        StreetItemToken res = new StreetItemToken(_arg1, _arg2);
        res.typ = _arg3;
        res.isRailway = _arg4;
        return res;
    }

    public static StreetItemToken _new1586(com.pullenti.ner.Token _arg1, com.pullenti.ner.Token _arg2, StreetItemType _arg3, boolean _arg4, int _arg5) {
        StreetItemToken res = new StreetItemToken(_arg1, _arg2);
        res.typ = _arg3;
        res.isRailway = _arg4;
        res.nounIsDoubtCoef = _arg5;
        return res;
    }

    public StreetItemToken() {
        super();
    }
    
    static {
        m_RegTails = new String[] {"ГОРОДОК", "РАЙОН", "МАССИВ", "МАСИВ", "КОМПЛЕКС", "ЗОНА", "КВАРТАЛ", "ОТДЕЛЕНИЕ", "ПАРК", "МЕСТНОСТЬ", "РАЗЪЕЗД", "УРОЧИЩЕ", "САД", "МЕСТОРОЖДЕНИЕ"};
        m_SpecTails = new String[] {"БУДКА", "КАЗАРМА"};
    }
}
