Humanize string function used in https://humanize-ai.click/
npm install humanize-ai-libAI-generated content often contains subtle markers that make it obvious to readers (and algorithms) that the text wasn't written by a human:
Em-dashes (—) instead of regular dash (-)
Fancy quotes (“ ”) instead of standard ones (")
Unnecessary whitespace or hidden Unicode characters
And other symbols
Cleaning these up makes the text flow more naturally, improving readability and keeping readers engaged.
This package contains humanization function used on http://humanize-ai.click/
Usage is simple:
``ts
import { humanizeString } from 'humanize-ai-lib';
const result = humanizeString(inputText, options);
console.log(result.text); // Humanized text
console.log(result.count); // Count of changed symbols
`
Options:
| Parameter | Type | Default | Description |
| ----------------------------- | --------- | ------- | ------------------------------------------------------------------------------------------------------- |
| transformHidden | boolean | true | Removes hidden unicode symbols |transformTrailingWhitespace
| | boolean | true | Removes spaces at the end of line |transformNbs
| | boolean | true | Replaces Non-Breaking Space character with regular space |transformDashes
| | boolean | true | Replaces fancy dashes with regular dash (-) |transformQuotes
| | boolean | true | Replaces fancy single and double quotes with regular quotes (' and ") |transformOther
| | boolean | true | Replaces … with ... |keyboardOnly
| | boolean | false` | Removes all symbols that cannot be typed with regular keyboard. Applied after all other transformations |
Made with 💗 by Nordthx
Check out my other project IMS Creators - game design editor & project management for game developers
MIT