Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
suffix-thumb
Advanced tools
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.
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'
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
learn transformations between two sets of words
The npm package suffix-thumb receives a total of 33,959 weekly downloads. As such, suffix-thumb popularity was classified as popular.
We found that suffix-thumb demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.