kanatype-insensitive sorting using Unicode Collation Algorithm
This commit is contained in:
parent
d071c09822
commit
c4f5c776e2
|
@ -23,6 +23,7 @@ import fitz
|
|||
from libsixel import *
|
||||
from PIL import Image
|
||||
from jinja2 import Environment, PackageLoader, select_autoescape
|
||||
import pyuca
|
||||
import rarfile
|
||||
import requests
|
||||
|
||||
|
@ -1151,10 +1152,11 @@ def generate(args):
|
|||
|
||||
print(f'\x1b[2K\r{idx+1}/{len(works)} works processed...', end=('' if idx+1 < len(works) else '\n'))
|
||||
|
||||
uca = pyuca.Collator().sort_key
|
||||
def make_categorization(categorization, query, work_filter, work_style_cards=False):
|
||||
categorization_dir = site_dir / categorization
|
||||
|
||||
cats = sorted((cat for (cat,) in cur.execute(query)), key=str.casefold)
|
||||
cats = sorted((cat for (cat,) in cur.execute(query)), key=uca)
|
||||
cat_samples = {}
|
||||
for cat in cats:
|
||||
cat_works = list(filter(work_filter(cat), works))
|
||||
|
|
|
@ -60,6 +60,7 @@
|
|||
setuptools
|
||||
libsixel
|
||||
(rarfile.override { useUnrar = true; })
|
||||
pyuca
|
||||
];
|
||||
src = ./.;
|
||||
};
|
||||
|
|
|
@ -13,6 +13,7 @@ dependencies = [
|
|||
"importlib_resources",
|
||||
"libsixel-python",
|
||||
"rarfile",
|
||||
"pyuca",
|
||||
]
|
||||
|
||||
[project.scripts]
|
||||
|
|
Loading…
Reference in a new issue