将一个人的名字拆分为名字和姓氏 [英] Splitting a person's name into forename and surname

查看:33
本文介绍了将一个人的名字拆分为名字和姓氏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的所以基本上我是在问他们的名字我希望这是一个输入,而不是名字和姓氏.

ok so basically I am asking the question of their name I want this to be one input rather than Forename and Surname.

现在有什么办法可以拆分这个名字吗?并只取句子"中的最后一个词,例如

Now is there any way of splitting this name? and taking just the last word from the "Sentence" e.g.

name = "Thomas Winter"
print name.split() 

而输出的只是冬天"

推荐答案

您会发现使用这种方法的关键问题不是技术问题,而是人为问题 - 不同的人以不同的方式书写自己的名字.

You'll find that your key problem with this approach isn't a technical one, but a human one - different people write their names in different ways.

事实上,名"和姓"的术语本身就有缺陷.

In fact, the terminology of "forename" and "surname" is itself flawed.

虽然许多混血家庭使用带连字符的姓氏,例如 Smith-Jones,但也有一些人单独使用这两个名字,即Smith Jones",其中两个名字都是姓氏.

While many blended families use a hyphenated family name, such as Smith-Jones, there are some who just use both names separately, "Smith Jones" where both names are the family name.

许多欧洲姓氏有多个部分,例如de Vere"和van den Neiulaar".有时,这些临时演员有​​着重要的家族历史——例如,数百年前国王授予的前缀.

Many european family names have multiple parts, such as "de Vere" and "van den Neiulaar". Sometimes these extras have important family history - for example, a prefix awarded by a king hundreds of years ago.

附带问题:我已经为我所引用的人正确地大写了这些字母 - de"和van den"对于某些家庭没有大写字母,但对于其他家庭却有大写字母.

Side issue: I've capitalised these correctly for the people I'm referencing - "de" and "van den" don't get captial letters for some families, but do for others.

相反,许多亚洲文化将姓氏放在首位,因为家庭被认为比个人更重要.

Conversely, many Asian cultures put the family name first, because the family is considered more important than the individual.

最后一点 - 有些人非常重视初级"或高级"或III"——并且您的代码不应将它们视为姓氏.

Last point - some people place great store in being "Junior" or "Senior" or "III" - and your code shouldn't treat those as the family name.

还注意到有相当多的人使用的名字不是他们父母赋予的名字,我使用以下方案取得了一些成功:

Also noting that there are a fair number of people who use a name that isn't the one bestowed by their parents, I've used the following scheme with some success:

全名(通常用于寻址邮件);姓;已知为(会话中常用的名称).

Full Name (as normally written for addressing mail); Family Name; Known As (the name commonly used in conversation).

例如:

全名:威廉·盖茨三世;姓氏:盖茨;别名:比尔

Full Name: William Gates III; Family Name: Gates; Known As: Bill

全名:宋丽;姓:宋;别名:丽莎

Full Name: Soong Li; Family Name: Soong; Known As: Lisa

这篇关于将一个人的名字拆分为名字和姓氏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆