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

@miloter/simil-words

v1.0.1

Published

It allows to obtain the similarities of words and texts as well as the normalization of texts to different forms.

Downloads

2

Readme

Similarity and normalization of texts.

It allows to obtain the similarities of words and texts as well as the normalization of texts to different forms.

Note:

simil-words is an ESM module so you will need to add to your package.json: "type": "module"

Installation

npm install @miloter/simil-words

Usage

import SimilWords from '@miloter/simil-words';

const swUpper = new SimilWords();
const swLower = new SimilWords(true);

const unNormalized = `
    En un día y  \t lugar \n de LA mancha de
    cuyo NOMBRE
    no quiero
    acordarme...
`;
console.log('Sin normalizar:')
console.log(unNormalized);
console.log('Forma normalizada a mayúsculas: ==>')
console.log(swUpper.normalize(unNormalized, true));
console.log('Forma normalizada sin caso de caracteres: ==>')
console.log(swUpper.normalize(unNormalized));
console.log('Forma normalizada a minúsculas: ==>')
console.log(swLower.normalize(unNormalized, true));
console.log('Forma normalizada a minúsculas con guiones separadores: ==>')
console.log(swLower.normalize(unNormalized, true, '-'));

Examples

Parent char

import SimilWords from '@miloter/simil-words';

const swUpper = new SimilWords();
const swLower = new SimilWords(true);
// Por defecto los caracteres padre están en mayúsculas
console.log('Padres en mayúsculas:')
console.log(swUpper.parentChar('á'));
console.log(swUpper.parentChar('ö'));
console.log(swUpper.parentChar('ñ'));
// Se cambia a minúsculas
console.log('Padres en minúsculas:')
console.log(swLower.parentChar('Á'));
console.log(swLower.parentChar('Ö'));
console.log(swLower.parentChar('Ñ'));

Words

import SimilWords from '@miloter/simil-words';

const swUpper = new SimilWords();
const swLower = new SimilWords(true);

const text = `
    En un día y  \t lugar \n de LA mancha de
    cuyo NOMBRE
    no quiero
    acordarme...
`;
// Obtenemos las palabras sin caso
console.log('Palabras sin caso:');
console.log(swUpper.getWords(text));
console.log('Palabras padre en mayúsculas:');
console.log(swUpper.getWords(text, true));
console.log('Palabras padre en minúsculas:');
console.log(swLower.getWords(text, true));

Similarity Levenshtein

import SimilWords from '@miloter/simil-words';

const text1 = 'En un día y   lugar  de LA mancha';
const text2 = 'En un lugar de LA mancha';
const text3 = 'En un lugar de la mancha';

console.log('Similitud entre textos:');
console.log(text1);
console.log(text2);
console.log('Similitud de Levenshtein:', SimilWords.similitud(text1, text2));
console.log('--------------------------');
console.log(text2);
console.log(text3);
console.log('Similitud de Levenshtein:', SimilWords.similitud(text2, text3));
console.log('--------------------------');

Improved similarity

import SimilWords from '@miloter/simil-words';

const text1 = 'En un día y   lugar  de LA mancha';
const text2 = 'En un lugar de LA mancha';

console.log('Similitud entre textos:');
console.log(text1);
console.log(text2);
console.log('Similitud mejorada (subconjuntos: false. No penalizar palabras: false):',
    SimilWords.similText(text1, text2, false, false));
console.log('-----------------------------------------------------------------------------------');
console.log('Similitud mejorada (subconjuntos: false. No penalizar palabras: true):',
    SimilWords.similText(text1, text2, false, true));
console.log('-----------------------------------------------------------------------------------');    
console.log('Similitud mejorada (subconjuntos: true. No penalizar palabras: false):',
    SimilWords.similText(text1, text2, true, false));
console.log('-----------------------------------------------------------------------------------');    
console.log('Similitud mejorada (subconjuntos: true. No penalizar palabras: true):',
    SimilWords.similText(text1, text2, true, true));
console.log('-----------------------------------------------------------------------------------');