waza-hs/README.md
2025-01-12 06:14:39 +00:00

1.1 KiB

waza-hs

wazajisho library for handling japanese text in haskell

cover

FileUtils.h

for managing dictionaries we have a custom data structure, and you can use it that way:

-- Access all directories in the list of FileGroups
let directories = map directory fileGroups
print directories -- ["/mnt/data1", "/mnt/data2"]

-- Access all file lists in the list of FileGroups
let filesList = map files fileGroups
print filesList -- [["file1.mdx", "file2.css"], ["file3.mdx", "file4.png"]]

-- Filter the FileGroups where any file in the files list contains ".mdx"
let mdict_filter = filter (\group -> any (isSuffixOf ".mdx") (files group)) fileGroups

-- Access all files of the filtered FileGroups
let mdict_files = map files mdict_files

you can for example, pass that list as a parameter for loading all of those dictionaries in mdict-cpp

TODO: move those functions to be some kind of helpers or operators