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

transcription-cleaner

v1.0.4

Published

Multi-language voice-to-text transcription cleaner. Removes repeated words/phrases across 8 languages (EN, NL, DE, PT, CS, PL, ES, FR)

Downloads

642

Readme

transcription-cleaner

Multi-language voice-to-text transcription cleaner, written in TypeScript.

Removes filler interjections (um, uh, …), collapses repeated words (but butbut) and repeated phrases (we should we shouldwe should), normalizes whitespace, and adds end punctuation.

Installation

npm install transcription-cleaner

Quick Start

TypeScript / ES modules

import TranscriptionCleaner, { Language } from 'transcription-cleaner';

const cleaner = new TranscriptionCleaner(Language.EN);
const result = cleaner.clean('we should we should go');
console.log(result); // "we should go."

CommonJS (JavaScript)

const TranscriptionCleaner = require('transcription-cleaner');

const cleaner = new TranscriptionCleaner('en');
console.log(cleaner.clean('we should we should go')); // "we should go."

Languages

Use the Language enum (recommended in TypeScript) or the equivalent string code:

| Enum | Code | Language | | ------------- | ---- | ---------- | | Language.EN | en | English | | Language.NL | nl | Dutch | | Language.DE | de | German | | Language.PT | pt | Portuguese | | Language.CS | cs | Czech | | Language.PL | pl | Polish | | Language.ES | es | Spanish | | Language.FR | fr | French |

API

new TranscriptionCleaner(language?, options?)

Creates a cleaner for the given language. Defaults to Language.EN. Throws if the language is not supported.

| Option | Default | Description | |---|---|---| | fuzzy | true | Collapse near-duplicate words/phrases via edit distance | | maxWordDistance | 1 | Max Levenshtein distance per word | | minFuzzyLength | 4 | Words shorter than this are never fuzzy-matched | | maxPhraseTokenMismatches | 1 | Max differing tokens allowed in a fuzzy phrase match |

clean(rawText: string): string

Returns the cleaned transcription.

cleanWithDetails(rawText: string): CleanDetails

Returns the result of each pipeline step, useful for debugging. The CleanDetails object contains:

  • original
  • step_1_normalize_whitespace
  • step_2_remove_interjections
  • step_3_remove_word_repetitions
  • step_4_remove_phrase_repetitions
  • fuzzyMerges — every word/phrase that was collapsed, with kept, dropped, and distance
  • final
const cleaner = new TranscriptionCleaner(Language.EN, { fuzzy: true });
const details = cleaner.cleanWithDetails('we should we shoud go');

console.log(details.final);        // "we should go."
console.log(details.fuzzyMerges);  // [{ kind: 'phrase', kept: 'we should', dropped: 'we shoud', distance: 1 }]

Fuzzy matching

By default only exact repetitions are removed. Enable fuzzy mode to also catch near-duplicates from voice-to-text mishearings:

const fz = new TranscriptionCleaner(Language.EN, { fuzzy: true });

fz.clean('should shoud go')        // → "should go."   (word, distance 1)
fz.clean('we should we shoud go')  // → "we should go." (phrase, 1 fuzzy token)
fz.clean('the the go')             // → "the go."       (exact, always works)
fz.clean('de je boom')             // → "de je boom."   (< 4 chars, skipped)

Development

npm install      # install dependencies
npm test         # run tests (ts-node src/test.ts)
npm start        # run examples (ts-node src/example.ts)
npm run build    # compile to dist/ (tsc)
npm run dev      # watch mode

License

MIT