Initial toolkit: scripts, references, skills, and term database

This commit is contained in:
iacore
2026-07-10 21:01:02 +08:00
commit ac9e6e3d1f
51 changed files with 5192 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
#!/usr/bin/env fish
# Split combined bilingual .dj into source.dj (CN) and target.dj (EN)
# Usage: split-bilingual.fish <combined.dj>
# Output: source.dj and target.dj in same directory, paragraphs separated by blanks
set dj (realpath $argv[1])
set dir (dirname $dj)
rm -f "$dir/source.dj" "$dir/target.dj"
for line in (cat $dj)
if string match -qr '[\x{4e00}-\x{9fff}]' -- $line
echo $line >> "$dir/source.dj"
echo >> "$dir/source.dj"
else if test -n (string trim -- $line)
echo $line >> "$dir/target.dj"
echo >> "$dir/target.dj"
end
end
echo "source.dj: $dir/source.dj"
echo "target.dj: $dir/target.dj"