Skip to content

Commit 72cac2f

Browse files
committed
xrefs wip
1 parent 8875715 commit 72cac2f

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

ferramentas/list_symbols.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env python3
2+
3+
import fileinput
4+
from collections import Counter
5+
import unicodedata
6+
7+
def main():
8+
non_ascii = Counter()
9+
for line in fileinput.input():
10+
if line.isascii():
11+
continue
12+
for char in line:
13+
if not char.isascii():
14+
non_ascii[char] += 1
15+
16+
17+
for char, count in non_ascii.most_common():
18+
name = unicodedata.name(char)
19+
print(f'{count:5d} {char} {name}')
20+
21+
22+
if __name__ == '__main__':
23+
main()

print/1/experimento-1/cap02.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,8 @@ Considere o <<ex_listcomp_x_filter_map>>.
291291
>>> beyond_ascii = [ord(s) for s in symbols if ord(s) > 127]
292292
>>> beyond_ascii
293293
[162, 163, 165, 8364, 164]
294-
>>> beyond_ascii = list(filter(lambda c: c > 127, map(ord, symbols)))
294+
>>> beyond_ascii = list(filter(lambda c: c > 127,
295+
... map(ord, symbols)))
295296
>>> beyond_ascii
296297
[162, 163, 165, 8364, 164]
297298
----

0 commit comments

Comments
 (0)