Coder Social home page Coder Social logo

blissymbolics / blissymbols Goto Github PK

View Code? Open in Web Editor NEW
23.0 8.0 5.0 4.81 MB

A database of all official Blissymbols, and their definitions

Home Page: http://blissymbolics.github.io/blissymbols

License: GNU General Public License v3.0

JavaScript 96.70% CSS 0.22% TypeScript 1.97% HTML 0.77% Python 0.34%

blissymbols's Introduction

Blissymbols

A database of all official Blissymbols, and their definitions. Plus some additional utilities. Contents:

  • blissdata_chars.js, blissdata_words.js: this are the most important files, the database itself
  • blissviewer.js: a generic Javascript module for attaching Blissymbols to text
    • this file is compiled from the corresponding TypeScript file blissviewer.ts
  • blissviewer.css: example CSS style sheet for displaying the Blissymbols
  • blissviewer-demo.html: a simple webpage that shows how blissviewer.js can be used; you can test it out here:

There are only three global names that are introduced by the library: BLISS_CHAR_DATA, BLISS_WORD_DATA and BlissViewer are defined by blissdata_chars.js, blissdata_words.js and blissviewer.js, respectively. They are supposed to be used like this:

var myBlissViewer = new BlissViewer(BLISS_CHAR_DATA, BLISS_WORD_DATA, {...})

(The third argument to the BlissViewer constructor is an optional configuration dictionary).

Below are some more detailed information about blissdata_(chars/words).js and blissviewer.js.

blissdata_(chars/words).js

These are Javascript files that encode all metadata about all official Blissymbols. The database consists of two Javascript objects BLISS_CHAR_DATA and BLISS_WORD_DATA, with the following structures:

BLISS_WORD_DATA = {
    "words": {
        // a "word" consists of a horizontal sequence of "chars" or "words":
        "snowplow,snowplough": ["vehicle,carriage,railway_car", "minus,no,without", "snow"],
        "Tarzan": ["make-believe_man", "tropical_rain_forest,jungle"],
        ...,
    },
};
BLISS_CHAR_DATA = {
    "chars": {
        // a "char" consists of a number of positioned "shapes", and a width and height:
        "make-believe_man": {h:5, w:128, d:[{d:"@0049",x:0,y:64}]},
        "meeting,encounter": {h:7, w:288, d:[{d:"@0118",x:0,y:160}, {d:"@0143",x:160,y:160}]},
        ...,
    },
    "center": {
        // for some "chars" the indicator should not be centered:
        "development": -64,
        "tool,instrument": 16,
        ...,
    },
    "kerning_left": {
        // this specifies where the leftmost parts of a "char" are:
        "make-believe_man": 26,  // binary 11010
        "tool,instrument": 4,  // binary 00100
        ...,
    },
    "kerning_right": {
        // this specifies where the rightmost parts of a "char" are:
        "development": 4,  // binary 00100
        "make-believe_man": 26,  // binary 11010
        ...,
    },
    "paths": {
        // a "path" is a basic form:
        "#A90-W:32": {form:"arc", x1:8, y1:0, x2:8, y2:32, h:32, r:22.627, w:8},
        "#CIRCLE:64": {form:"circle", x:32, y:32, r:32, w:64, h:64},
        "#TEXT:n:56": {form:"text", x:0, y:0, w:32, h:56, text:"n", fontsize:77},
        ...,
    },
    "shapes": {
        // a "shape" consists of a number of other "shapes" or "paths":
        "+0043": [{x:0, y:64, d:"#CIRCLE:64"}, {x:64, y:0, d:"#L+90:96"}],
        "@0927": [{x:0, y:0, d:"+0174"}, {x:144, y:32, d:"+0028"}],
        ...,
    },
};

As it happens, the database file is stored in a format that is readable as a Python file too.

There is a TypeScript description file for the database format: blissdata.d.ts.

blissviewer.js

This Javascript file is compiled from the TypeScript file blissviewer.ts. It defines a class BlissViewer, which is instantiated like this:

var myBlissViewer = new BlissViewer(data, config?)

The arguments are as follows:

  • data is the Blissymbol database (preferrably BLISSDATA as defined in blissdata.js)
  • config is an optional dictionary for setting parameters:
    • margin: the extra margin to add around each Blissword (default value: 8 pixels, to account for a stroke width of 8 pixels)
    • radius: the radius of a dot (default value: 4 pixels)

A BlissViewer has the following public methods:

myBlissViewer.add_blissvg = function(parent, blissword, ?grid)
myBlissViewer.add_blissword = function(parent, ?blissword, ?textword, ?grid)
myBlissViewer.add_blisstext = function(parent, blisswords, ?textwords, ?grid)
myBlissViewer.add_blisswords_to_class = function(cls, ?grid)

The arguments are as follows:

  • parent should be a reference to a HTML container (such as <span>, <div> or <p>).
  • blissword(s) is a (list of) Blissword(s), where each word is either a Blissymbol id (which is a string), or a list of ids.
  • textword(s) is an optional (list of) text word(s), where each word is a string.

The functions append the (sequence of) blissword(s) to the parent container. The textword(s) is added below each Blissword, if present. See blissviewer-demo.html and blissdemo.js for an example of how it can be used.

Note about the database

The database is split into two files, one for the characters and one for the words. This is because all updates of word definitions should be made using the Karp online lexicon, from Språkbanken:

There is a script, download_and_update_blissdata_words.py, which is run irregularly to keep the database in this repository in sync with Karp.

blissymbols's People

Contributors

heatherleaf avatar hlridge avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blissymbols's Issues

How do you want to help out?

If you are interested in Blissymbolics, and want to help out in some way, please leave a comment here! Also, if you are developing resources for Blissymbolics you can mention and link to them in a comment. If we're lucky there could be new collaborations and even ideas for applications and projects.

blissdata_words.js needs an update

Since a number of characters have been added or changed name, blissdata_words.js needs an update, too, to make the references to blissdata_chars.js right.

Incorrect spacing between index numbers

I realize this project hasn't been touched in awhile, but I thought I'd add it in case it ever revives.

The Blissviewer does not put correct spacing between adjacent digits numbers (i.e. BCI-AV# 8496-8504). The Fundamental Rules of Blissymbolics specifies on page 6 (page 7 of the PDF) that "the width is 1⁄8 of a matrix square between two digits". This is illustrated in a figure immediately below the containing paragraph.

Instead of 1⁄8, the Blissviewer puts 1⁄4 of a space, as seen here (Blissymbol for money added to show height of full matrix square):

image

In the above figure, the space between the two digits should be halved.

This appears to me to be a bug, since these lines appear to be intended to do exactly this.

syntax guide?

How would I get the symbols for I, you, he, she etc; I assumed something like person_(1), person_(2) etc; based on the the sample text & the blissymbols for the words themselves, but that doesn't seem to work. It just shows question marks. Is there an easy to understand guide available for how to figure out what to type to get specific symbols or is one in the works? If not maybe an autocomplete that suggest words as you're typing? For example if I type "boy", it could suggest possibilities, like "boy,lad", & if you click on one it enters it. This illustrates the main problem I see with Blissymbolics in general. The syntax seems to be very complex or at least unnecessarily unclear, compared to other languages. Even a language like Japanese whose syntax is very strange compared to most languages is consistent & not entirely impossible to understand. Even if you can learn the 2,000 blissymbols, you may not be able to figure out the syntax to correctly write a sentence that anybody could read, let alone read someone else's, defeating the whole purpose of blissymbolics to begin with. Grammar is considered by many linguists to be more time consuming when trying to learn a new language than vocabulary. I don't necessarily agree, but I'm not a linguist either.

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.