humanization
humanization
is a library that seeks to simulate human patterns of mistakes when typing text. It can serve as a kind of ergonomic layer for automated chatbots to make them feel more human.
Getting started
import { humanize } from "humanization";
humanize("All their equipment and instruments are alive.");
humanize("Thanks so much!", {
repetition: {
probability: 0.1,
type: "WORD"
},
thanks: {
probability: 1.0,
type: "WORD",
apply: word => (word.toLowerCase() === "thanks" ? "thx" : word)
}
});
Development
Testing
yarn test
or yarn test --watch
Building