# @datagica/classify

> Naive document classifier

Latest version **0.0.2** (published 2017-03-04) · GPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install @datagica/classify
pnpm add @datagica/classify
yarn add @datagica/classify
bun add @datagica/classify
```

## 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.2 |
| Published | 2017-03-04 |
| First published | 2016-04-15 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Julian Bilcke |
| Maintainers | datagica |

## Links

- npm: https://www.npmjs.com/package/@datagica/classify
- Repository: https://github.com/datagica/classify
- Homepage: https://github.com/datagica/classify#readme
- Issues: https://github.com/datagica/classify/issues
- npm.io page: https://npm.io/package/@datagica/classify

## Recent versions

- 0.0.2 (latest) — 2017-03-04
- 0.0.1 — 2017-03-04
- 0.0.0 — 2016-04-15

## README

# @datagica/classify

Naive document classifier. Because sometimes you really don't need more.

### Installation

   $ npm install --save @datagica/classify

### Usage

```javascript
const Classify = require("@datagica/classify");

const classify = Classify({
  en: {
    show: [ 'tv', 'show', 'tv show', 'tv channel', 'episode'],
    movie: [ 'cinema', 'movie theater', 'movie', 'new movie', 'upcoming movie']
  },
  fr: {
    show: [ 'télé', 'séries', 'séries tv', 'série', 'télévisée',
            'série télévisée', 'série télé', 'série tv', 'épisode'],
    movie: [ 'film', 'nouveau film', 'prochain film', 'cinema' ]
  }
});

classify("in this new tv show").then(result => {
  console.log(result)
})

// will output:
{
  categories: [ 'show', 'en' ],
  score: 2
}


classify("in this upcoming movie").then(result => {
  console.log(result)
})

// will output:
{
  categories: [ 'movie', 'en' ],
  score: 1
}
```

### TODO

For now it will only works for two levels of classification (the two levels are actually required). In the future, this may be changed to be a bit more flexible.

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