An open API service indexing awesome lists of open source software.

https://github.com/ariya/text-sim

calculate the similarity between two words or phrases
https://github.com/ariya/text-sim

Last synced: 7 months ago
JSON representation

calculate the similarity between two words or phrases

Awesome Lists containing this project

README

          

# Text Similarity

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

## Getting Started

1. Install the required dependencies by running:

```bash
npm install
```

2. Use the `text-sim.js` script to compare two words or phrases:

```bash
./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":

```bash
./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)