tolkien-stress

0.2.0 • Public • Published

Tolkien Stress Analyser

A website and package to determine the stressed syllable of a word in one of Tolkien’s languages.

Website usage

Open the website and enter your text into the text box. Optionally, change the language with the radio buttons, if you know what language your text is in.

Package usage

Install the tolkien-stress package from NPM. Two functions are available for import (as an ECMAScript module):

import { analyseWord, analyseText } from 'tolkien-stress';

const { syllableBreaks, stressedSyllable } = analyseWord('Boromir', 'Sindarin');
console.log(syllableBreaks); // 0, 2, 4, 7: |bo|ro|mir|
console.log(stressedSyllable); // 0: BOromir

const segments = analyseText('Gil-galad', 'Sindarin');
console.log(segments[0]); // { word: 'Gil', syllableBreaks: [ 0, 3 ], stressedSyllable: 0 }
console.log(segments[1]); // '-'
console.log(segments[2]); // { word: 'galad', syllableBreaks: [ 0, 2, 5 ], stressedSyllable: 0 }

Resources

License

This software is published under the ISC license, which you may find in the LICENSE file that accompanies this repository. By contributing to this software, you agree to publish your contribution under that license.

Dependencies (0)

    Dev Dependencies (6)

    Package Sidebar

    Install

    npm i tolkien-stress

    Weekly Downloads

    0

    Version

    0.2.0

    License

    ISC

    Unpacked Size

    9.73 kB

    Total Files

    4

    Last publish

    Collaborators

    • lucaswerkmeister