dicutil

package
v0.0.0-...-5a1af90 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2023 License: Unlicense Imports: 14 Imported by: 1

Documentation

Overview

Package dicutil provides methods for offline processing to build Pāli Dictionary. This package is for offline processing and not used in frontend code.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildSuccinctTrieFromDir

func BuildSuccinctTrieFromDir(wordsJsonDir, trieJsonPath string) (err error)

func BuildVFS

func BuildVFS(pkgName, wordJsonDir, outputDir string) (err error)

func CreateMetadataGoCode

func CreateMetadataGoCode(pkgName, metadataDir, outputGoFilePath string) error

CreateMetadataGoCode create a data.go file which embed metadata directly in Go code.

func CreatePrefixSymlink(prefix, root string) (err error)

CreatePrefixSymlink create symbolic links for pages of Pali words to the root index.html of the website root directory. This is for deploying single page application (SPA) on GitHub Pages or GitLab Pages, which serve only static website content.

The URL path of prefix:

/browse/{{first char of word}}/

This page contains all Pali words starts with the prefix.

func CreateWordSymlink(word, root string) (err error)

CreateWordSymlink create symbolic links for pages of Pali words to the root index.html of the website root directory. This is for deploying single page application (SPA) on GitHub Pages or GitLab Pages, which serve only static website content.

The URL path of word:

/browse/{{first char of word}}/{{word}}/

This page contains the definition of the Pali word.

func EmbedPOJSONInGoCode

func EmbedPOJSONInGoCode(domain, localedir, pkgName, outputGoDataFilePath string) (err error)

func GetOneDictionay

func GetOneDictionay(csv1, csv2, bookId string)

func PO2JSONBytes

func PO2JSONBytes(domain, localedir string) (b []byte, err error)

PO2JSON converts PO files to JSON bytes.

func ParseDictionayBookCSV

func ParseDictionayBookCSV(inBookCsv, outJson string)

Input is CSV file containing information of dictionary books of all languages. Output is parsed result and save in JSON file.

func ParseDictionayWordCSV

func ParseDictionayWordCSV(csv1, csv2, outputdir string)

func SaveCsv

func SaveCsv(data [][]string, bookId string)

func SymlinkToRootIndexHtml

func SymlinkToRootIndexHtml(websiteroot string, words []string) (err error)

SymlinkToRootIndexHtml creates symbolic links which points all pages of the website to the root index.html in the root directory of the website. The purpose is to deploy single page application (SPA) on GitHub Pages or GitLab Pages, which serves only static website contents.

Only one page: “/index.html“

All other webpages are symlinks to “/index.html“

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL