fix(输入法): 修复光标间隙并扩大26键及明确大小写切换

这个提交包含在:
sydxky 于 2026-11-14 19:37:32 +08:00 提交
1 父节点 b95e7caae7
当前提交 100757f684
35 个文件已更改
+675 -243

没有与搜索条件相匹配的文件

@@ -49,6 +49,16 @@ def from94(value):
return number
def convert(source, target):
target.parent.mkdir(parents=True, exist_ok=True)
assert target.resolve().is_relative_to((APP/'src/assets').resolve())
marker=target.parent/('.'+target.name+'.generating')
with marker.open('x',encoding='ascii') as handle:handle.write('generating')
try:
_convert(source,target)
finally:
marker.unlink()
def _convert(source, target):
files = {p.name: p.read_bytes() for p in source.glob('*.dat')}
frequency_path=APP/'third_party/jieba/dict.txt'
frequencies={}
@@ -82,8 +92,8 @@ def convert(source, target):
# Only replace files listed in the previous generated manifest.
if (target/'meta.json').exists():
previous=json.loads((target/'meta.json').read_text(encoding='utf-8'))
for name in previous['shards']:
assert re.fullmatch(r'(?:short|s?[0-9]+|ds?[0-9a-d]+)',name)
for name in [*previous['shards'],*previous.get('association_shards',[]),*previous.get('completion_shards',[])]:
assert re.fullmatch(r'(?:short|s?[0-9]+|ds?[0-9a-d]+|[ac][0-9a-f]{2})',name)
old=target/(name+'.json')
if name not in shards and old.exists():old.unlink()
for name, content in shards.items():
@@ -101,7 +111,9 @@ def convert(source, target):
for name in shards:
(restored14 if name.startswith('d')else restored).update(json.loads((target/(name+'.json')).read_text(encoding='utf-8'))['entries'])
assert restored == entries and restored14 == entries
report = dict(upstream='https://github.com/crabPangXie/crabKeyboard',
report = dict(association_seed_sha256=hashlib.sha256((APP/'src/common/association-seeds.json').read_bytes()).hexdigest(),
generator_sha256=hashlib.sha256(pathlib.Path(__file__).read_bytes()).hexdigest(),
upstream='https://github.com/crabPangXie/crabKeyboard',
commit='93d36b5002dee80a3d253b1ec7ec9e29800a104c',
variant='pinyinDictV5_20260416', keys=len(entries),
candidates=sum(map(len, entries.values())), shards=sorted(shards),