npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

enhanced-word-aligner-rcl

v1.4.8

Published

A React Component Library for UnfoldingWord Suggesting Word Aligner.

Readme

EnhancedWordAligner

A React component library for advanced word alignment between source and target languages with AI-powered suggestions.

📋 Overview

The Enhanced Word Aligner provides a powerful interface for creating and managing alignments between source and target language texts. It builds upon the SuggestingWordAligner from the word-aligner-rcl module, adding intelligent alignment suggestions through WordMap technology. The WordMap technology is enhanced by the uw-wordmapbooster module (forked from wordmapbooster) and the background wordMap training logic comes from the alignment-transferer app.

Key Features:

  • Interactive word alignment interface
  • AI-powered alignment suggestions
  • Background training for improved suggestions
  • Cross-platform compatibility (including NextJS support)

🚀 Installation

# npm
npm install enhanced-word-aligner-rcl

# yarn
yarn add enhanced-word-aligner-rcl

🎨 UI Demo in Styleguidist

Start styleguidist:

yarn && yarn start

Then open browser to http://localhost:6003/

  • Note that there are two demos, but only one can be running or the suggester will break
    • the EnhancedWordAligner.md example shows a basic suggesting aligner.
    • the EnhancedWordAlignmentTool.md example shows a complete word alignment tool.
    • to only show the complete word alignment tool:
      • rename EnhancedWordAlignmentTool.md.hide to EnhancedWordAlignmentTool.md and rename EnhancedWordAligner.md to EnhancedWordAligner.md.hide
    • then to only show the basic suggesting aligner:
      • rename EnhancedWordAligner.md.hide to EnhancedWordAligner.md and rename EnhancedWordAlignmentTool.md to EnhancedWordAlignmentTool.md.hide

🧩 Components

EnhancedWordAligner

The main component that provides an interactive interface for aligning words with suggestions.

useAlignmentSuggestions Hook

A custom hook that provides background word alignment training and suggestions.

import { useAlignmentSuggestions, createAlignmentTrainingWorker } from 'enhanced-word-aligner-rcl';

const alignmentSuggestionsManager = useAlignmentSuggestions({
  contextId,
  shown: isVisible,
  sourceLanguageId: 'el-x-koine',
  targetLanguageId: 'en',
  createAlignmentTrainingWorker,
  handleTrainingStateChange: updateTrainingStatus
});

// Access the suggestion function
const { suggester } = alignmentSuggestionsManager.actions;

Important: For alignment training to run in the background, the component using this hook must remain mounted.

TrainingStateProvider

Manages and provides access to the current training state of the alignment model. The useTrainingStateContext hook can be used anywhere within the component tree that is wrapped by the TrainingStateProvider to get the current training state.

import { TrainingStateProvider, useTrainingStateContext } from 'enhanced-word-aligner-rcl';

// Wrap components that need access to training state
<TrainingStateProvider translate={translate} verbose={true}>
  <YourComponent />
</TrainingStateProvider>

// In child components:
const { state, actions } = useTrainingStateContext();
const { trainingComplete, trainingStatusStr } = state;
const { handleTrainingStateChange } = actions;

High-level View of Alignment Suggestor

  • the TrainingStateProvider wraps the UsersAlignmentApp
  <TrainingStateProvider
  />
    <UsersAlignmentApp>
  </TrainingStateProvider>
  • in the UsersAlignmentApp, useTrainingStateContext hook is used to get the current training state. And useAlignmentSuggestions hook will be used once within the component tree to handle initialization of the background training of alignment suggestions, as well as management of the suggestor. If control of the suggestor is needed in a child component, then the actions returned by useAlignmentSuggestions() can be passed as a property to the child component.

💻 Development

# Install dependencies
yarn

# Start Styleguidist server
yarn start

💻 Publish

# Install dependencies
yarn

# build and publish
yarn prepublishOnly
yarn publish

Then open your browser to http://localhost:6003/

🔄 Platform-Specific Information

  • the EnhancedWordAligner.md example shows how to run in StyleGuidist.
  • For NextJS integration, please refer to README_NEXTJS.md which describes how to run the Model training background worker in a web app (not styleguidist). Note that the difference is in the implementation of TrainingStateProvider.

📚 Documentation

For detailed information:

Example implementation: EnhancedWordAligner.md

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📄 License

This project is licensed under the terms of the MIT license.