/text-sim

calculate the similarity between two words or phrases

Primary LanguageJavaScriptMIT LicenseMIT

Text Similarity

A simple tool to calculate the similarity between two words or phrases.

Getting Started

  1. Install the required dependencies by running:
npm install
  1. Use the text-sim.js script to compare two words or phrases:
./text-sim.js "word1" "word2"

Replace "word1" and "word2" with the desired words or phrases. If the words contain spaces, enclose them in quotes.

Example Usage

Compare the similarity between "coffee" and "cafe":

./text-sim.js coffee cafe

This will output a similarity score between 0 and 1, where:

  • 1 indicates a perfect match (the words are identical or very closely related)
  • 0 indicates no relation at all (the words are completely unrelated)