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

30 lines
No EOL
1.1 KiB
Markdown

# waza-hs
wazajisho library for handling japanese text in haskell
<img src="https://git.ajattix.org/hashirama/waza-hs/raw/branch/main/misc/cover.jpg" alt="cover" width="30%" height="30%">
### FileUtils.h
for managing dictionaries we have a custom data structure, and you can use it that way:
```haskell
-- 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](https://github.com/dictlab/mdict-cpp)
TODO: move those functions to be some kind of helpers or operators