lsm

lsm

Determine textual likeness with Language Style Matching

Showing:

Popularity

Downloads/wk

0

GitHub Stars

5

Maintenance

Last Commit

6yrs ago

Contributors

1

Package

Dependencies

1

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

LSM

An interface for using Language Style Matching to determine the likeness of different texts and their authors.

Installation

npm install lsm

Usage

var LSM = require('lsm');

var text_1 = "In my younger and more vulnerable years my father gave me some advice that I've been turning over in my mind ever since. \"Whenever you feel like criticizing any one,\" he told me, \"just remember that all the people in this world haven't had the advantages that you've had.\"";

var text_2 = "I'm a romantic; a sentimental person thinks things will last, a romantic person hopes against hope that they won't.";

var result = LSM.compare(text_1, text_2);
console.log(result);
// 0.3410958093994814

A likeness value of 1 indicates that the compared samples are identical in their proportions of function words. A value of 0 indicates total dissimilarity.

Testing

npm test

The samples used to test LSM were extracted from Imogen Binnie's Nevada and Torrey Peter's The Masker.

What is Language Style Matching?

Language Style Matching (LSM) uses function words -- like conjunctions, pronouns, prepositions, etc. -- as proxies for the author's personality. LSM calculates likeness between texts by comparing the proportions of different classes of function words.

In research, LSM has proven a resilient indicator of compatibility in romance, friendship, and business.

Read the Economist's thoughts on it, or check out the science:

License

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial