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
- Host: GitHub
- URL: https://github.com/ariya/text-sim
- Owner: ariya
- License: mit
- Created: 2025-02-20T02:13:11.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-02-20T02:13:25.000Z (8 months ago)
- Last Synced: 2025-03-09T19:49:07.660Z (7 months ago)
- Language: JavaScript
- Homepage:
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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)