A minimal conlang api written in Typescript with Hono
- TypeScript 100%
|
|
||
|---|---|---|
| src | refactor: move rewrite to generateWords | |
| test | feat: add frequen and groups | |
| .gitignore | chore: remove request.json | |
| bun.lock | Add the basics, with only CV structure | |
| LICENSE | chore: change license to GPL3 | |
| package.json | chore: change script to dev instead of start:dev | |
| README.md | docs: fix url on README | |
| tsconfig.json | feat(tsconfig): add some excludes | |
Why?
This is api for conlangs (Construct Languages), Good words generators are rarely then I made my own. I am extending this to be more than generate words.
Warning
this is still in development
How to build
only two dependencies in this API: Bun and Hono
- clone the repo
git clone https://github.com/devEducaua/lexicongenerator.git
- install the dependencies
bun install
- compile
bun run build
- run the api
bun run start
How to use
runs in the port :8080, all endpoints prefixed with /api/
/generate
this endpoint generate a list of words based on the informations that you send, send a POST method request. here an example body:
{
"groups": {
"C": [ "p", "t", "k", "l", "m", "n", "s" ],
"V": [ "a", "i", "u" ],
"F": [ "m", "n" ]
},
"numberWords": 30,
"maxLength": 4,
"minLength": 1,
"exclusions": [ "ti" ],
"structs": "CVF",
"rewrites": {}
}
/frequen
this endpoint discover what is the most common phonemes on a text. send a POST method request, example body:
{
"phonemes": [ "o", "a", "e" ],
"text": "The quick brown fox jumps over the lazy dog"
}