Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tolkien-stress

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tolkien-stress

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

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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

  • The Lord of the Rings, Appendix E
  • To determine whether a word is Quenya or Sindarin (for the tests and the explanation section):

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.

Keywords

FAQs

Package last updated on 20 Jun 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc