Giter Site home page Giter Site logo

scago's Introduction

scago ⛵️

Release Workflow Status

scago (or sound change applier go) is a go library that can apply a sound change ruleset to a word. It's a useful tool in conlanging communities for artificially creating diachronic change in a constructed language.

The library is inspired by KathTheDragon's SCE, a similar tool implemented in Python.

Usage

Standalone

Make sure that you have the binary folder of your gopath in your shell path (usually $HOME/go/bin; or $GOPATH/bin if your gopath differs from default)

go install go.m5ka.dev/scago/cmd/scago@latest
scago -r "a > e / #_" abacus

Library

package main

import (
	"fmt"
	"go.m5ka.dev/scago"
)

func main() {
    s := scago.New()
    err := s.AddCategory("P", []string{"p", "b", "t", "d", "k", "g"})
    if err != nil {
        fmt.Println("Couldn't add category!", err)
        return
    }
    err = s.AddRule("a > e / _P")
    if err != nil {
        fmt.Println("Couldn't add rule!", err)
        return
    }
    output, err := s.Apply("aba")
    if err != nil {
        fmt.Println("Couldn't apply ruleset!", err)
        return
    }
    fmt.Println(output) // Outputs: eba
}

scago's People

Contributors

m5ka avatar

Stargazers

 avatar  avatar  avatar  avatar Luke Halpin avatar Jesse Phillips avatar Dáel Muñiz avatar

Watchers

James Cloos avatar  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.