You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For example, we need to always use try-except with PetrovichGenderDetector:
gender_detector=PetrovichGenderDetector()
try:
gender=gender_detector.detect(lastname=lastname, firstname=firstname, middlename=middlename)
exceptStopIterationase:
logger.warning(f'Can not to predict gender to inflect {self.signatory}, default value will be used (MALE)')
gender=Gender.MALE
It's not intuitive, especially the StopIteration exception.
Probably it would be better if we would returned ANDROGYNOUS or something like UNKNOWN. What do you think?
Код ниже вызывает исключение
StopIteration
:Думаю в таком случае метод
detect
должен возвращатьGender.ANDROGYNOUS
The text was updated successfully, but these errors were encountered: