Git Product home page Git Product logo

scoregismu's Introduction

perl scoreGismu.pl [-g file | -G file] [-m num] [input file]

scoreGismu.pl implements steps 2 through 5 of the gismu scoring algorithm described in §4.14 of The Complete Lojban Language to produce a gismu from a given set of source words. Each line of input to the program specifies a set of Lojbanized source words and their language weights, e.g.:

iun 0.347 upiog 0.196 emploi 0.160 us 0.123 primin 0.089 amal 0.085

(If the same word appears more than once in the same line, its final weight is the sum of its listed weights.) Alternatively, a line may contain only Lojbanized source words, in which case the weights are the number of times each word appears on the line.

For each input line, scoreGismu.pl will calculate the gismu that match the given source words the best according to the scoring algorithm and output the top 5 scores (or an amount specified with the -m switch) and the gismu that obtained them. Note that calculations for separate lines do not take each other into account, and so if multiple gismu sets are produced at once, they may conflict with each other.

A file containing a list of pre-existing gismu, one per line, may optionally be specified with the -g switch. Any gismu listed in this file or that conflicts with a gismu in this file will be excluded from consideration for the algorithm.

A file containing a list of potential gismu, one per line, may optionally be specified with the -G switch. Only the gismu listed in this file will be considered by the algorithm. If both a -g switch and a -G switch are given, the -g switch is ignored.

This code was originally taken from [1], where it was credited to one "Hussell".

For reference, the language weights used in creating the official gismu were, as listed in §4.14 of the CLL:

Chinese     0.36
English     0.21
Hindi       0.16
Spanish     0.11
Russian     0.09
Arabic      0.07

Some later gismu instead used the weights:

Chinese     0.347
Hindi       0.196
English     0.160
Spanish     0.123
Russian     0.089
Arabic      0.085

scoregismu's People

Contributors

jwodder avatar

Watchers

 avatar  avatar  avatar

Forkers

lagleki

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.