真正的字母排序...... [英] true alphabetic sort...

查看:55
本文介绍了真正的字母排序......的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我正在使用快速排序算法按字母顺序对

国家/地区列表进行排序。这非常有效,直到某人

想出了?land群岛......这就在列表的最后。


我不是确定它应该是。


现在我可以改变我的比较,所以它忽略了最高位,但这个

然后会把它放在列表的顶部,甚至在阿尔巴尼亚之前...

或者,我应该放?之后A?


简而言之,有没有首选的订购方式?


谢谢,


Ian

At the moment I''m using a quicksort algorithm to sort a list of
countries in alphabetic order. This worked wonderfully until someone
came up with the ?land Islands... and this is at the end of the list.

I''m not sure it''s supposed to be.

Now I could just alter my comparison so it ignores the top bit, but this
would then put it at the top of the list, even before Albania...
Alternatively, should I put ? after A?

In short, is there a preferred way of ordering these?

Thanks,

Ian

推荐答案

Ian Richardson< za ***** @ chaos.org.uk> skrev:
Ian Richardson <za*****@chaos.org.uk> skrev :
目前我正在使用快速排序算法按字母顺序对
国家列表进行排序。这非常有效,直到有人想出了?land群岛......这就在列表的最后。
At the moment I''m using a quicksort algorithm to sort a list of
countries in alphabetic order. This worked wonderfully until someone
came up with the ?land Islands... and this is at the end of the list.




是的,而且它'是的。


瑞典语,丹麦语和挪威语是?

字母表中的最后一个字母。

-

Knud



Yes, and it''s correct.

In swedish, danish and norwegian is "?" the last letter in the
alphabet.
--
Knud


Knud Gert Ellentoft于2004年4月24日在comp.lang.javascript中写道
Knud Gert Ellentoft wrote on 24 apr 2004 in comp.lang.javascript:
在瑞典语中,丹麦语和挪威语是?。
字母表中的最后一个字母。
In swedish, danish and norwegian is "?" the last letter in the
alphabet.




只是好奇:


这将写入? over:


document.write('''''。toLowercase)


这适用于所有欧洲字母表吗?


=============================


我应该使用:


document.write('''''。toLocaleLowerCase())




-

Evertjan。

荷兰。

(请将x''es更改为我的电子邮件地址中的点数)



Just curious:

This will write "?" overhere:

document.write(''?''.toLowercase)

Does this work for all European alphabets?

=============================

When should I use:

document.write(''?''.toLocaleLowerCase())

?

--
Evertjan.
The Netherlands.
(Please change the x''es to dots in my emailaddress)


" Evertjan。" <前************** @ interxnl.net>写道:
"Evertjan." <ex**************@interxnl.net> writes:
只是好奇:

这会写? overhere:

document.write(''?''。toLowercase)

这适用于所有欧洲字母表吗?


适用于任何Unicode字母,使用Unicode字符数据库

进行翻译。

====== =======================

我什么时候应该使用:

document.write('' ?''。toLocaleLowerCase())
Just curious:

This will write "?" overhere:

document.write(''?''.toLowercase)

Does this work for all European alphabets?
It works for any Unicode letter, using the Unicode character database
for the translation.
=============================

When should I use:

document.write(''?''.toLocaleLowerCase())




从不,对于字母?而言。

在ECMA 262中,第15.5节。 4.17,使用

toLocaleLowerCase的原因是针对语言规则与常规Unicode映射冲突的语言。以Tukish为例。


/ L

-

Lasse Reichstein Nielsen - lr*@hotpop.com

DHTML死亡颜色:< URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>

''没有判断的信仰只会降低神灵的精神。''



Never, for the letter "?".
In ECMA 262, secion 15.5.4.17, the reason given for using
toLocaleLowerCase, is for languages where the language rules conflict
with the regular Unicode mapping. Tukish is given as an example.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
''Faith without judgement merely degrades the spirit divine.''


这篇关于真正的字母排序......的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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