如何在记录表中存储人员姓名

时间:2021-05-24 20:49:25

Intro

Damn, this is harder then I thought.

该死的,这比我想的要难。

Some people have camel-case names like McDonald or O'Ferncher, and some do not have double-barrelled name, but hyphenated name like Bowes-Lyon or just given name, like Honovi Hohnihhohkaiyohos ( Strong High Backed Wolf ). In some culture spaces like:

有些人有像McDonald或O'Ferncher这样的骆驼名字,有些人没有双管名字,但是像Bowes-Lyon这样的连字符或者只是名字,如Honovi Hohnihhohkaiyohos(Strong High Backed Wolf)。在一些文化空间,如:

  • Portuguese you have more then 1 family name and more then 1 first name (by default).
  • 葡萄牙语你有超过1个姓氏和1个名字(默认情况下)。

  • Russia you have middle name (patronymic), that is obligatory.
  • 俄罗斯你有中间名(patronymic),这是必须的。

In some places you have gender inequality and to formally address a person you need to use prefix, like: Sir (where gender can be male, female and in-between). And yes, prefix changes depending on the persons age.

在某些地方,你会遇到性别不平等,并正式向一个人提出你需要使用前缀的人,比如:先生(性别可以是男性,女性和中间人)。是的,前缀根据人的年龄而变化。

Like this is not enough - people can and will get married (this occurs pretty often)(thy might do this multiple times), and it is a default custom for at least one partner to change their family name. In most places people can change their name or at least given name. 如何在记录表中存储人员姓名

这样还不够 - 人们可以并且将会结婚(这种情况经常发生)(你可能多次这样做),并且这是至少一个合作伙伴更改其姓氏的默认习惯。在大多数地方,人们可以更改自己的名字或至少更名。

More details

This is not important if you want to answer the question, just giving a hint what I'm trying to do.

如果你想回答这个问题,只是暗示我正在尝试做什么,这一点并不重要。

Tables where I want to store the names are in xml and appengine datastore with twig object store interface (I use twig among other things, for it enables me to compile schema). Data itself can come form various places and probably there exists a case where old name is used (so - storing multiple names).

我想要存储名称的表位于带有twig对象存储接口的xml和appengine数据存储区中(我使用twig和其他东西,因为它使我能够编译模式)。数据本身可以来自不同的地方,并且可能存在使用旧名称的情况(因此 - 存储多个名称)。

My best guess is:

我最好的猜测是:

@XmlAttribute @Key protected Long id;
@XmlElement(required = true) final protected List<String> lastName;
@XmlElement(required = false) protected String middleName;
@XmlElement(required = true) final protected List<String> firstName;
@XmlElement(required = true) protected Boolean isMale;
@XmlElement(required = true) protected Date birthday;
//+locale for naming?

Writing function or preconditions for compareTo method just makes My day ... I'm seriously considering 0 fault tolerance. Yes, meaning existence or lack of apostrophes, whitespace and other symbols or case difference can yield to different results. (And for cynical bastards - this is not homework.)

为compareTo方法编写函数或前置条件只是让我的日子...我正在认真考虑0容错。是的,意味着存在或缺少撇号,空格和其他符号或大小写差异可能产生不同的结果。 (对于愤世嫉俗的混蛋 - 这不是功课。)

The question was: How to store persons name in a record table?

问题是:如何在记录表中存储人名?

1 个解决方案

#1


3  

If you are looking for a simple, universal solution, I think you will find that there is none. Read this blog posting, and weep.

如果您正在寻找一个简单,通用的解决方案,我想您会发现没有。阅读此博客帖子,然后哭泣。

And when you've finished crying, take a look at this document, which attempts to model names for a US American audience. Obviously it makes a lot of simplifying assumptions, which are probably invalid.

当你哭完之后,看一下这个试图为美国美国观众建模名字的文件。显然它会产生很多简化的假设,这可能是无效的。

#1


3  

If you are looking for a simple, universal solution, I think you will find that there is none. Read this blog posting, and weep.

如果您正在寻找一个简单,通用的解决方案,我想您会发现没有。阅读此博客帖子,然后哭泣。

And when you've finished crying, take a look at this document, which attempts to model names for a US American audience. Obviously it makes a lot of simplifying assumptions, which are probably invalid.

当你哭完之后,看一下这个试图为美国美国观众建模名字的文件。显然它会产生很多简化的假设,这可能是无效的。