Coder Social home page Coder Social logo

glossa's Introduction

Gem Version

Note: Version 1.0.0 is an (almost) direct port of mewo2's JavaScript naming-language generator. These initial ideas are his, and I have changed very little of the actual inner-workings (other than basically turn it into a class). I would highly encourage everybody to go and checkout his original repo (link above), read his documentation on how the language generator works, and follow @unchartedatlas

Recent Updates

  • v1.1.0 - Added import/export functionality! Now you can save your languages for later
  • v1.0.3-1.0.5 - gemspec description changes (way to go RDoc Markdown processor, you're nothing like the others. I hope you feel special)
  • v1.0.2 - Minor re-factor moving Glossa::Language into its own file, removed some debug statements, and fixed a bug that was generating morphemes with a key of nil

Installation

gem install glossa

Usage

Glossa is a module that holds the API for a "naming language generator generator."

You can create a basic language via lang = Glossa::Language.new, a random language by lang = Glossa::Language.new(true), or you can create a language with specific rules by passing in a hash: Glossa::Language.new(false, options)

Additionally, you can create an instance of a new language by importing a JSON language file: lang = Glossa::Language.import(path)

Creating an instance of Language like this will provide you with a name/word generator that follows the specific rules for syllables, phonemes, morphology, orthography etc. that were defined in initialization.

Generate a new name: lang.make_name([optional type]). This will create a new name constructed using a mash of typed and un-typed phonemes.

Generate a new word: lang.get_word([optional type]). Will create a simpler than a name but unique word.

Passing in a type will generate phonemes that have only that type in order to create words that sound unified.

At any time, you can export a JSON file with the state of your language generator (including all the words and names you've already generated) by lang.export(path).

Example Usage

lang.make_name("tree")

lang.make_name("city")

lang.make_name

lang.get_word("city")

lang.get_word

TODO

I'll go ahead and put the same ideas as mewo2 had for his language tool, and add some of my own too:

  • Synchronic sound changes: rules which change some of the sounds depending on context (e.g. German /d/ becomes /t/ at the end of a word, Latin /k/ becomes /ʧ/ before /i/ or /e/)
  • Historical sound changes: start with an 'ancestral form' and evolve the word systematically. Do this in multiple ways to produce a family of languages.
  • Generated scripts: why should a generated language use the Roman alphabet? How do these people write things among themselves? Invent an alphabet (or similar) and show how the names are really spelled.
  • Better grammar: break our morphemes out into roots and modifiers, and come up with some rules about how they're combined

glossa's People

Contributors

jakofranko avatar

Stargazers

Theo avatar

Watchers

James Cloos avatar  avatar Theo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.