# covectric

> Covectric is a simple vector based search engine using cosine similarity and tf-idf methods for finding text similarity.

Latest version **0.0.7** (published 2019-06-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install covectric
pnpm add covectric
yarn add covectric
bun add covectric
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.7 |
| Published | 2019-06-09 |
| First published | 2014-04-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 12.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | Matt Palmerlee |
| Maintainers | mpalmerlee |
| Keywords | covectric, vector, search, tf-idf, cosine, similarity, text |

## Links

- npm: https://www.npmjs.com/package/covectric
- Repository: https://github.com/mpalmerlee/covectric
- Homepage: https://github.com/mpalmerlee/covectric#readme
- Issues: https://github.com/mpalmerlee/covectric/issues
- npm.io page: https://npm.io/package/covectric

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.0.7 (latest) — 2019-06-09
- 0.0.6 — 2014-04-18
- 0.0.5 — 2014-04-18
- 0.0.4 — 2014-04-17
- 0.0.3 — 2014-04-15
- 0.0.2 — 2014-04-14
- 0.0.1 — 2014-04-14

## README

covectric
=========

Covectric is a simple vector based search engine using cosine similarity and tf–idf methods for finding text similarity between documents.

Define "covectric"
------------------

Two documents are said to be covectric if they share at least one dimension (or term).



Install
-------
```bash
> npm install covectric
```


Usage
-----
```javascript
//instantiate the model
var covectric = require('covectric');
var model = new covectric.Model();

//populate the vector space and weight tokens based on term frequency
var id = 1;
['hello','hi','hi there','hey','hi to you'].forEach(function(t) {
	model.upsertDocument(id++, t, t);
});
model.recomputeVectorBaseTokenWeights();

//search the vector space

var results = model.search("hi bob", 3);
console.log("Search Results:", results);

```


Samples
-------
See the samples directory in the repo for more examples of using Covectric


Reference
---------
http://en.wikipedia.org/wiki/Vector_space_model

http://en.wikipedia.org/wiki/Cosine_similarity

http://en.wikipedia.org/wiki/Tf-idf


License
-------
MIT Licensed

---
_Source: https://npm.io/package/covectric · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
