如何通过示例向非技术测试人员解释排序(数字、字典和排序规则)? [英] How to explain sorting (numerical, lexicographical and collation) with examples to non technical testers?

查看:11
本文介绍了如何通过示例向非技术测试人员解释排序(数字、字典和排序规则)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用法语和西班牙语的名字和姓氏来解释差异.任何指针表示赞赏.我用谷歌搜索,但结果并不令人满意.

I need to explain the differences using French and Spanish first and last names. Any pointers are appreciated. I did a Google search but the results are not satisfactory.

推荐答案

这里有一些解释:

在这种情况下,您对文本进行排序而不考虑数字.事实上,数字只是字母",它们没有数字组合的意义.

In this case, you sort text without considering numbers. In fact, numbers are just "letters", they have no numeric combined meaning.

这意味着文本ABC123"按字母 A、B、C、1、2 和 3 排序,而不是按 A、B、C 和数字 123 排序.

This means that the text "ABC123" is sorted as the letters A, B, C, 1, 2 and 3, not as A, B, C and then the number 123.

这有一个不幸的后果,即订购可能看起来应该像数字一样订购的东西却没有.

This has the unfortunate consequence that ordering things that might look like they should order like numbers doesn't.

例如,在对这两个进行排序时:

For instance, when sorting these two:

ABC90
ABC100

您可能期望 90 的排序在 100 之前,因为 90 排在 100 之前,但这不是字典排序的工作原理,它将 9 与 1 进行比较,然后交换它们.

You might expect the one with 90 to be sorted before 100 because 90 comes before 100, but that's not how lexicographical ordering works, it compares the 9 with the 1, and then swaps them around.

这是使上述排序正常工作的排序,通过在 100 之前排序 90.如果在两个文本中都遇到数字,自然排序会切换到部分文本的数字排序.

This is the ordering that would make the above ordering work properly, by sorting 90 before 100. Natural ordering switches to numeric ordering for a portion of the text, if it encounters numbers in both texts.

这个处理诸如语言之间的变化之类的事情.

This one handles things like variations between languages.

通常,字典顺序将一个字母与另一个字母进行比较,并确定它们的顺序,通常根据字母的值".这可能会产生一些奇怪的效果.

Normally, lexicographical ordering compares one letter to another letter, and determines their order, usually according to the "value" of the letter. This can have some strange effects.

例如,您认为以下两个字符串如何排序?

For instance, how do you think the following two strings would be ordered?

ABCTEN
ABCßEN

好吧,由于 ß 的字母可能具有比 T 更高的值的序数值(即它在 Unicode 字母表中的位置"),因此上述顺序就是结果.基本上,如果您查看包含所有字母的 Unicode 图表,您可能会发现 T 的符号值小于 100,而 ß 大于 100.

Well, since the letter for ß might have an ordinal value (ie. its "place" in the Unicode alphabet) that has a higher value than the T, the above order is what would be the outcome. Basically, if you go look in the Unicode chart that contains all the letters, you might find that T has a symbol value of less than 100, and the ß be above 100.

但是,在德国,您应该将上述两个文本视为:

However, in Germany, you should consider the above two texts as this:

ABCTEN
ABCSSEN

因此它们的顺序应该颠倒,因为 S 在 T 之前.

and thus their order should be reversed, since S comes before T.

这是基于排序规则的排序.您为您的文本选择一个排序规则,该排序规则描述了应该处理这些文本的上下文.这使您可以在不同语言中获得自然排序.

This is collation-based ordering. You pick a collation for your text that describes the context in which those texts should be processed. This allows you to get natural ordering in different languages.

例如,在挪威,字母 Æ、Ø 和 Å 被排在 Z 之后,但在其他语言中(我忘了是哪个),Æ 应该排在 E 之后,Ø 排在 O 之后,Å 就在在 A 之后.排序规则规定了这一点.

For instance, in Norway, the letters Æ, Ø and Å are ranked as coming directly after the Z, however in other languages (I forget which), Æ should be ranked just after E, Ø just after O and Å just after A. The collation dictates this.

这篇关于如何通过示例向非技术测试人员解释排序(数字、字典和排序规则)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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