/*
 * 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#.NET project. 
 * The latest version of the code is available on the site www.pullenti.ru
 */

const Hashtable = require("./../../unisharp/Hashtable");

const PersonNormalResult = require("./PersonNormalResult");
const PersonNormalHelper = require("./internal/PersonNormalHelper");

/**
 * Результат нормализации короткого текста, где только персона
 */
class PersonNormalData {
    
    /**
     * Создать и обработать текст
     * @param txt текст с ФИО персоны, если они в разных полях ввода, то разделять переходом на новую строку
     */
    constructor(txt) {
        this.lastname = null;
        this.lastnameAlt = null;
        this.firstname = null;
        this.firstnameAlt = null;
        this.middlename = null;
        this.gender = 0;
        this.resTyp = PersonNormalResult.UNDEFINED;
        this.coef = 0;
        this.errorMessage = null;
        this.corrWords = new Hashtable();
        if (txt !== null) 
            PersonNormalHelper.analyze(this, txt, null);
    }
    
    toString() {
        return (String(this.coef) + " (" + String(this.resTyp) + "): " + ((this.lastname != null ? this.lastname : "")) + " " + ((this.firstname != null ? this.firstname : "")) + " " + ((this.middlename != null ? this.middlename : "")));
    }
}


module.exports = PersonNormalData