Answer the question
In order to leave comments, you need to log in
How to find English surnames in the text?
There is a list of usernames in English. How to determine what is the name and surname?
With pymorphy2, but it only defines in Russian. And how to define English surnames?
import pymorphy2
name_list = ['Василий', 'Екатерина', 'Супер', 'Aleksandra', 'Bybee', 'William']
for name in name_list:
print(any('Name' in p.tag for p in morph.parse(name)))
Answer the question
In order to leave comments, you need to log in
pymorphy2 is a lexical analyzer for the Russian language.
use NLTK, spacy
ps with names/surnames in English text is a complete disaster - any name can be a surname
Do the opposite then. That is, if True is returned to you, you return False and vice versa.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question