Calculates the lexicographical distance between two texts.
npm install mol_text_distanceCalculates the lexicographical distance between two texts.
- A simple and fast.
- Text profile based.
- Normalized from 0 (equal) to 1 (different).
- Rearrangement of words gives short distance.
- Different texts length support.
- Independent of changes position.
- Complexity O(n).
- Memory usage O(log n).
- For equal length texts it's a metric).
``tslittle meerkat jumps over big elephant
// 0.18
$mol_text_distance(
,over little elephant jumps big meerkat
,
)
// 0.66
$mol_text_distance(
A structural comparison of arbitrary objects is discussed.,Application of caching for correct comparison of cyclic references is disclosed.
,`
)
`tsprofile
const profile1 = $mol_text_profile( )prodir
const profile2 = $mol_text_profile( )`
const distance = $mol_text_profile_distance( profile1, profile2 ) // 0.54
`sh`
npm install mol_text_distance
1KB 
`ts``
import { $mol_text_distance } from 'mol_text_distance'