Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
97225da2
Kaydet (Commit)
97225da2
authored
Kas 24, 2002
tarafından
Martin v. Löwis
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Sort names independent of the Python version. Fix hex constant warning.
Include all First/Last blocks.
üst
5b21df4a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
makeunicodedata.py
Tools/unicode/makeunicodedata.py
+11
-7
No files found.
Tools/unicode/makeunicodedata.py
Dosyayı görüntüle @
97225da2
...
...
@@ -16,6 +16,7 @@
# 2002-09-11 wd use string methods
# 2002-10-18 mvl update to Unicode 3.2
# 2002-10-22 mvl generate NFC tables
# 2002-11-24 mvl expand all ranges, sort names version-independently
#
# written by Fredrik Lundh (fredrik@pythonware.com)
#
...
...
@@ -403,10 +404,13 @@ def makeunicodename(unicode, trace):
wordlist
=
words
.
items
()
# sort on falling frequency
# XXX: different Python versions produce a different order
# for words with equal frequency
wordlist
.
sort
(
lambda
a
,
b
:
len
(
b
[
1
])
-
len
(
a
[
1
]))
# sort on falling frequency, then by name
def
cmpwords
((
aword
,
alist
),(
bword
,
blist
)):
r
=
-
cmp
(
len
(
alist
),
len
(
blist
))
if
r
:
return
r
return
cmp
(
aword
,
bword
)
wordlist
.
sort
(
cmpwords
)
# figure out how many phrasebook escapes we need
escapes
=
0
...
...
@@ -541,10 +545,10 @@ class UnicodeData:
char
=
int
(
s
[
0
],
16
)
table
[
char
]
=
s
# expand first-last ranges
(ignore surrogates and private use)
# expand first-last ranges
if
expand
:
field
=
None
for
i
in
range
(
0
,
0x
D8
00
):
for
i
in
range
(
0
,
0x
1100
00
):
s
=
table
[
i
]
if
s
:
if
s
[
1
][
-
6
:]
==
"First>"
:
...
...
@@ -587,7 +591,7 @@ def myhash(s, magic):
h
=
0
for
c
in
map
(
ord
,
s
.
upper
()):
h
=
(
h
*
magic
)
+
c
ix
=
h
&
0xff000000
ix
=
h
&
0xff000000
L
if
ix
:
h
=
(
h
^
((
ix
>>
24
)
&
0xff
))
&
0x00ffffff
return
h
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment