wordmage
WordMage is a Crystal library for generating words for constructed languages (conlangs). It provides a flexible, phoneme-based system for creating realistic-sounding words with customizable patterns, constraints, and generation modes.
Installation
-
Add the dependency to your
shard.yml
:dependencies: wordmage: github: petterthowsen/wordmage
-
Run
shards install
Usage
require "wordmage"
puts "=== Words starting with vowels ==="
vowel_gen = WordMage::GeneratorBuilder.create
.with_phonemes(["p", "t", "k", "r"], ["a", "e", "i", "o"])
.with_syllable_patterns(["V", "CV", "CVC"])
.with_syllable_count(WordMage::SyllableCountSpec.range(2, 3))
.starting_with(:vowel)
.build
5.times do
puts vowel_gen.generate
end
Development
see CLAUDE.md
Contributing
- Fork it (https://github.com/petterthowsen/wordmage/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Contributors
- Petter Thowsen - creator and maintainer