@phughesmcr/reflectr@0.0.2
latest
phughesmcr/reflectrA simple NLP library to invert the first/second-person pronouns in English language strings
This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers




JSR Score
100%
Published
a year ago (0.0.2)
Reflectr
A small, simple, speedy NLP library to invert the first/second-person pronouns in English language strings.
- Preserves case, spacing, punctuation.
- Typescript types.
- Modern, strict, ES2022 code.
- Only 1 dependency (also by me).
Reflectr is intended to cope in most regular English language cases. This is a naive library which makes limited, sensible decisions. More complex cases may require advanced NLP techniques.
Usage
npm install reflectr
import { invert } from "reflectr"; // or "jsr:@phughesmcr/reflectr" if using Deno invert("I want to go to the moon"); // "You want to go to the moon"
For long strings, I recommend splitting by sentence first and then inverting each.
License
MIT
Add Package
deno add jsr:@phughesmcr/reflectr
Import symbol
import * as reflectr from "@phughesmcr/reflectr";
Import directly with a jsr specifier
import * as reflectr from "jsr:@phughesmcr/reflectr";
Add Package
pnpm i jsr:@phughesmcr/reflectr
pnpm dlx jsr add @phughesmcr/reflectr
Import symbol
import * as reflectr from "@phughesmcr/reflectr";
Add Package
yarn add jsr:@phughesmcr/reflectr
yarn dlx jsr add @phughesmcr/reflectr
Import symbol
import * as reflectr from "@phughesmcr/reflectr";
Add Package
vlt install jsr:@phughesmcr/reflectr
Import symbol
import * as reflectr from "@phughesmcr/reflectr";
Add Package
npx jsr add @phughesmcr/reflectr
Import symbol
import * as reflectr from "@phughesmcr/reflectr";
Add Package
bunx jsr add @phughesmcr/reflectr
Import symbol
import * as reflectr from "@phughesmcr/reflectr";