Code Monkey home page Code Monkey logo

syllable.js's Introduction

Syllable.js

This project was created during the coronavirus pandemic when schools were closed. The aim of the project was the creation of a new web application where children can enhance their reading skills using the Syllable-Method.

So what can you actually do with Syllable.js? You can colorize the syllables of words:

The following text

I love to play soccer. American football is nice.

transforms to

colorized english text

It works for german texts too. It even works for all languages which are supported by Hyphenopoly.

Install

Download the latest release of Hyphenopoly. You need the follwoing files/directories:

  • Hyphenopoly.js
  • Hyphenopoly_Loader.js
  • patterns/LANGUAGE.wasm

Replace LANGUAGE with the language you actually need. Additionally you need the latest release of Syllable.js.

Usage

First you have to load and initialize Hyphenopoly.

<script src="./Hyphenopoly_Loader.js"></script>
<script>
  var Separator = "•";
  
  Hyphenopoly.config({
    "require": {
      "en-us": "FORCEHYPHENOPOLY"
    },
    "setup": {
      "exceptions": { "global" : ""},
      "selectors": {
        ".hyphenate": {
          "hyphen": Separator,
          "minWordLength": 3
        }
      }
    }
  });
</script>

Then you can use Syllable.js:

<script src="./Syllable.js"></script>
<script>
...
    Hyphenopoly.hyphenators["en-us"].then((hyphenator) => {

      let SyllableConfig = {
        Separator: Separator,
        ExceptionsSeparator: " ",
        SourceText : "Some Source Text",
        FirstColor : "blue",
        SecondColor : "red",
        Exceptions : [ "S o m e" ],
        hyphenator : hyphenator
      };

      let SyllableText = convertText( SyllableConfig );

    });
...
</script>

At least the follwoing attributes of the configuration must be set:

  • SourceText
  • hyphenator

syllable.js's People

Contributors

andreasferdinand avatar mnater avatar

Watchers

 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.