# 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

from pullenti.unisharp.Utils import Utils

from pullenti.ner.person.PersonNormalResult import PersonNormalResult
from pullenti.ner.person.internal.PersonNormalHelper import PersonNormalHelper

class PersonNormalData:
    """ Результат нормализации короткого текста, где только персона """
    
    def __init__(self, txt : str) -> None:
        """ Создать и обработать текст
        
        Args:
            txt(str): текст с ФИО персоны, если они в разных полях ввода, то разделять переходом на новую строку
        """
        self.lastname = None;
        self.lastname_alt = None;
        self.firstname = None;
        self.firstname_alt = None;
        self.middlename = None;
        self.gender = 0
        self.res_typ = PersonNormalResult.UNDEFINED
        self.coef = 0
        self.error_message = None;
        self.corr_words = dict()
        if (txt is not None): 
            PersonNormalHelper.analyze(self, txt, None)
    
    def __str__(self) -> str:
        return "{0} ({1}): {2} {3} {4}".format(self.coef, Utils.enumToString(self.res_typ), Utils.ifNotNull(self.lastname, ""), Utils.ifNotNull(self.firstname, ""), Utils.ifNotNull(self.middlename, ""))