https://github.com/lynn/jvoxaskei
Haskell implementation of the Lojban lujvo-making algorithm
https://github.com/lynn/jvoxaskei
Last synced: 2 months ago
JSON representation
Haskell implementation of the Lojban lujvo-making algorithm
- Host: GitHub
- URL: https://github.com/lynn/jvoxaskei
- Owner: lynn
- License: mit
- Created: 2016-12-03T23:18:48.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-02-12T16:27:17.000Z (over 4 years ago)
- Last Synced: 2025-02-28T20:39:54.034Z (3 months ago)
- Language: Haskell
- Size: 653 KB
- Stars: 11
- Watchers: 5
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# la jvoxaskei
A Haskell implementation of the Lojban lujvo-making and lujvo-scoring algorithms.You can try it online [here](http://lynn.github.io/lujvo).
## The Lojban *what?*
[**Lojban**](http://lojbo.org/) is a [constructed human language](https://en.wikipedia.org/wiki/Constructed_language). The root [content words](https://en.wikipedia.org/wiki/Content_word) in Lojban, such as `cabna` (current) and `djedi` (day), can be smashed together into [compound words](https://en.wikipedia.org/wiki/Compound_(linguistics)) called *lujvo*, such as `cabdei` (today). This process follows a non-deterministic algorithm called the *lujvo-making algorithm*. Another algorithm exists to score its outputs for brevity and *niceness*: the lujvo that is assigned the lowest score is often chosen as the dictionary form of a new compound word.My program takes list of content words, generates all possible *lujvo*, optionally scores each of them, and then optionally selects the best result.
## Usage
```haskell
-- % ghci Lujvo.hs
-- GHCi, version 7.10.3: http://www.haskell.org/ghc/ :? for help
-- [1 of 3] Compiling Lojban ( Lojban.hs, interpreted )
-- [2 of 3] Compiling Rafsi ( Rafsi.hs, interpreted )
-- [3 of 3] Compiling Lujvo ( Lujvo.hs, interpreted )
-- Ok, modules loaded: Lujvo, Lojban, Rafsi.
>>> let tanru = ["lujvo", "xamsi", "kelci"]
>>> mapM_ print $ take 5 $ scoredLujvoList tanru
(8796,"jvoxaskei")
(9916,"luvyxaskei")
(10866,"jvoxaskelci")
(10926,"jvoxamsykei")
(10946,"lujvyxaskei")
>>> bestLujvo tanru
"jvoxaskei"
>>> bestLujvo ["tisna", "mabru"]
"tisymabru"
```