Socket
Socket
Sign inDemoInstall

suffix-thumb

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

suffix-thumb

learn transformations between two sets of words


Version published
Weekly downloads
43K
decreased by-14.69%
Maintainers
1
Weekly downloads
 
Created
Source
find the optimal transormations between sets of words
npm install suffix-thumb

suffix-thumb tries to discover the way two sets of words map to one another, according to changes in their suffix.

It was built to learn rules about verb conjugations, but in a way, it is just a generic compression algorithm.

The assumption is that a word's suffix is the most changeable part of a word.

carbon(1)

import { find, convert } from 'suffix-thumb'

const pairs = [
  ['walk', 'walked'],
  ['talk', 'talked'],
  ['go', 'went'],
]
let model = find(pairs)
/* { rules: [ ['alk', 'alked'] ],
    exceptions: {go:'went'},
    coverage: 0.66,
}*/

const pairs = [
  ['aail', 'aael'],
  ['bbil', 'bbel'],
  ['cil', 'cel'],
  ['snafoo', 'snabar'],
  ['poofoo', 'poobar'],
]
let model = find(pairs)
/*
  { 
    rules: [ 
      [ 'foo', 'bar', 2 ],
      [ 'il', 'el', 3 ]
    ],
    exceptions: {},
    percent: 100 
  }
*/

let out = convert('snafoo', model)
// 'snabar'

How it works

For each word-pair, it generates all n-suffixes of the left, and n-suffixes of the right.

any pattern between the two sets of words begins to pop out.

it reduces any redundancies in this list.

it then runs the patters on the dataset, to get a score, and any exceptions.

There may be wordlists with no helpful patterns.

Ideally, you should be able to take a list of word-pairs, create a model for them, and then delete the 2nd half of the word pairs.

MIT

FAQs

Package last updated on 09 Jul 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc