Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dgck81lnn/jvozba
sozysozbot_jvozba improved
https://github.com/dgck81lnn/jvozba
jvozba lojban
Last synced: 4 days ago
JSON representation
sozysozbot_jvozba improved
- Host: GitHub
- URL: https://github.com/dgck81lnn/jvozba
- Owner: DGCK81LNN
- License: mit
- Created: 2024-05-04T04:46:24.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-05-04T04:46:29.000Z (6 months ago)
- Last Synced: 2024-10-05T09:17:37.236Z (about 1 month ago)
- Topics: jvozba, lojban
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/@dgck81lnn/jvozba
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `@dgck81lnn/jvozba`
Slightly modified version of [`sozysozbot_jvozba`](https://github.com/sozysozbot/sozysozbot_jvozba) as an npm package.
The original project was made of scripts instead of modules; this version makes all TypeScript files modules and exports almost everything via `index.ts`.
Some modifications are made to make the library easier to use, such as:
* `jvozba_gui.ts` and `jvokaha_gui.ts` in the original project contained some useful logic which I generalized into the functions `jvozbaSmart()` and `jvokahaSmart()` and placed in a new `smart.ts`.
* Jvozba and jvokahaSmart return more information.
* Jvozba results containing experimental rafsi, as well as cmevla containing forbiddin la/lai/doi sequences, are always included but marked by boolean flags. Filter them out if necessary.
## Examples
```typescript
import { jvozbaSmart, jvokahaSmart } from "@dgck81lnn/jvozba"
``````typescript
jvozbaSmart("lab- ditcu")
// Returns:
;({
components: [ 'blabi', 'ditcu' ],
results: [
{
parts: [
{ selrafsi: 'blabi', part: 'lab', experimental: false },
{ selrafsi: 'ditcu', part: 'dit', experimental: true }
],
lujvo: 'labdit',
score: 5898,
cmevla: true,
usesExperimentalRafsi: true,
forbiddenLaLaiDoiCmevla: true
},
{
parts: [
{ selrafsi: 'blabi', part: 'lab', experimental: false },
{ selrafsi: 'ditcu', part: 'ditc', experimental: false }
],
lujvo: 'labditc',
score: 6928,
cmevla: true,
usesExperimentalRafsi: false,
forbiddenLaLaiDoiCmevla: true
},
{
parts: [
{ selrafsi: 'blabi', part: 'lab', experimental: false },
{ selrafsi: 'ditcu', part: 'ditcu', experimental: false }
],
lujvo: 'labditcu',
score: 7937,
cmevla: false,
usesExperimentalRafsi: false,
forbiddenLaLaiDoiCmevla: false
},
{
parts: [
{ selrafsi: 'blabi', part: 'blab', experimental: false },
{ selrafsi: null, part: 'y', experimental: false },
{ selrafsi: 'ditcu', part: 'dit', experimental: true }
],
lujvo: 'blabydit',
score: 8008,
cmevla: true,
usesExperimentalRafsi: true,
forbiddenLaLaiDoiCmevla: false
},
{
parts: [
{ selrafsi: 'blabi', part: 'blab', experimental: false },
{ selrafsi: null, part: 'y', experimental: false },
{ selrafsi: 'ditcu', part: 'ditc', experimental: false }
],
lujvo: 'blabyditc',
score: 9038,
cmevla: true,
usesExperimentalRafsi: false,
forbiddenLaLaiDoiCmevla: false
},
{
parts: [
{ selrafsi: 'blabi', part: 'blab', experimental: false },
{ selrafsi: null, part: 'y', experimental: false },
{ selrafsi: 'ditcu', part: 'ditcu', experimental: false }
],
lujvo: 'blabyditcu',
score: 10047,
cmevla: false,
usesExperimentalRafsi: false,
forbiddenLaLaiDoiCmevla: false
}
]
})
``````typescript
jvokahaSmart("najnimryjisr")
// Returns:
;[
{ part: 'naj', selrafsi: 'narju', experimental: false },
{ part: 'nimr', selrafsi: 'nimre', experimental: false },
{ part: 'y', selrafsi: null, experimental: false },
{ part: 'jisr', selrafsi: 'jisra', experimental: false }
]
```