Retext is a natural language processor powered by plugins part of the unified collective.

Overview

retext

Build Coverage Downloads Size Sponsors Backers Chat

retext is a natural language processor powered by plugins part of the unified collective.

Intro

retext is an ecosystem of plugins for processing natural language to do all kinds of things: check spelling, fix typography, or make sure text is readable.

This repository contains the following projects:

Sponsors

Support this effort and give back by sponsoring on OpenCollective!

Gatsby 🥇

Vercel 🥇

Netlify

Holloway

ThemeIsle

Boost Hub

Expo


You?

Contribute

See contributing.md in retextjs/.github for ways to get started. See support.md for ways to get help. Ideas for new plugins and tools can be posted in retextjs/ideas.

A curated list of awesome retext resources can be found in awesome retext.

This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.

License

MIT © Titus Wormer

Comments
  • Use ware to support async parsing

    Use ware to support async parsing

    Figured I'd throw in what it'd look like if retext supported async parsing middleware. One ability of parsing asynchronously is to query external datasets against words or phases during parsing. By using ware, we can also abstract the logic of supporting various async flows.

    🦋 type/enhancement 🧑 semver/major 🗄 area/interface 💪 phase/solved 
    opened by blakeembrey 14
  • Deno with esm.sh

    Deno with esm.sh

    Initial checklist

    Problem

    error: Import 'https://cdn.esm.sh/v57/[email protected]/es2021/nlcst-to-string.js' failed: 408 Request Timeout at https://cdn.esm.sh/v57/[email protected]/es2021/parse-latin.js:2:27264

    Deosn't seem to work with Deno yet.

    Solution

    support Deno

    Alternatives

    https://esm.sh

    👀 no/external 🏗 area/tools 👎 phase/no 
    opened by ralyodio 11
  • Cannot store function in variable.

    Cannot store function in variable.

    The following code executes as expected, reporting issues of the given text.

                    retext().use(readability).process(processedReview.text, function (err, file) {
                            console.log(report(file));
                    });
    

    However this one reports 'no issues found' for the exact same text. Am I missing some JS basics here? ATM I am really stuck, thank you for your help.

                    var process = retext().use(readability).process;
                    process(processedReview.text, function (err, file) {
                            console.log(report(file));
                    });
    
    🙋 no/question 
    opened by janwirth 11
  • processor.Parser is undefined

    processor.Parser is undefined

    If I use the example at https://github.com/wooorm/retext#usage, I get the error

    C:\Users\Morten\node_modules\retext-emoji\index.js:133
        var proto = processor.Parser.prototype;
                                    ^
    
    TypeError: Cannot read property 'prototype' of undefined
        at emoji (C:\Users\Morten\node_modules\retext-emoji\index.js:133:33)
        at Retext.use (C:\Users\Morten\node_modules\retext\index.js:113:19)
        at Object.<anonymous> (C:\Users\Morten\Desktop\retext.js:8:6)
        at Module._compile (module.js:434:26)
        at Object.Module._extensions..js (module.js:452:10)
        at Module.load (module.js:355:32)
        at Function.Module._load (module.js:310:12)
        at Function.Module.runMain (module.js:475:10)
        at startup (node.js:117:18)
        at node.js:951:3
    

    I have installed retext, retext-emoji and retext-smartypants and I'm using node v4.0.0.

    🙋 no/question 
    opened by mazing 9
  • Add `retext-case-police` to list of plugins

    Add `retext-case-police` to list of plugins

    Initial checklist

    • [x] I read the support docs
    • [x] I read the contributing guide
    • [x] I agree to follow the code of conduct
    • [x] I searched issues and couldn’t find anything (or linked relevant results below)
    • [x] If applicable, I’ve added docs and tests

    Description of changes

    Repository

    A retext plugin for checking popular names casing.

    Examples:

    • ⚠️ macbook → ✅ MacBook
    • ⚠️ MacOS → ✅ macOS

    For:


    Dictionaries are from case-police.

    📚 area/docs 💪 phase/solved 
    opened by JulianCataldo 8
  • Is this English only?

    Is this English only?

    First of all, awesome and really well done project. Congrats!

    Is it only for English? I mean, I saw that it supports latin chars, but would it work for say, separating syllables, or finding phonetics / rhymes in portuguese text?

    Thank you!!

    🙋 no/question 
    opened by lfilho 7
  • add link cliche plugin

    add link cliche plugin

    I made this plugin for checking for cliches.

    Any thoughts about it would be cool!

    Might want to hold off merging in until I can figure out how to get my travis test to pass on every version node though.

    Cheers

    🦋 type/enhancement 📚 area/docs 💪 phase/solved 
    opened by dunckr 6
  • Bower install hangs

    Bower install hangs

    I've tried multiple times to install this via Bower but it seems to hang in the same spot every single time. Tried cleaning cache but all attempts end in the same result. This is the line where it hangs:

    bower resolved      git://github.com/wooorm/array-iterate.git#0.1.0
    
    🙋 no/question 
    opened by remotesynth 6
  • Issue when parsing some sentences ending with numbers

    Issue when parsing some sentences ending with numbers

    Subject of the issue

    I stumbled upon a strange case where retext fails to detect some sentences ending with number (but not all).

    Your environment

    • OS: Windows & Linux
    • Packages: retext, unist-util-visit, nlcst-to-string

    Steps to reproduce

    I try to parse the following string "Hello 30. Hello world."

    const retext = require('retext');
    const visit = require('unist-util-visit');
    const toString = require('nlcst-to-string');
    
    var str = 'Hello 30. Hello world.'
    
    const tree = retext.parse(str);
    
    visit(tree, 'SentenceNode', (node)=>{
        console.log('>', toString(node));
    } );
    

    Expected behaviour

    output :

    > Hello 30.
    > Hello world.
    

    Actual behaviour

    output :

    > Hello 30. Hello world.
    

    Please note that if I test the same code with this string "Hello 3030. Hello world." , it works just fine.

    it seems to happen with numbers with less than four digits .

    🙅 no/wontfix 👎 phase/no 
    opened by alaa-eddine 5
  • Cannot figure out how to modify an existing tree

    Cannot figure out how to modify an existing tree

    Hello,

    thanks for retext — it is very elegant to use! Although I have managed to create a plugin which filters a tree, it seems the next plugin in the chain does not inherit of the changes of the previous plugin.

    Here is my high level code:

          retext()
            .use(retextStopwords, { stopwords: stopwordsFr })
            .use(retextKeywords)
            .process(text, (err, file) => {
                if (err) {
                return reject(err);
              }
    
              resolve({
                keywords: file.namespace('retext').keywords,
                keyphrases: file.namespace('retext').keyphrases
              });
            });
    

    retextKeywords is the retext-keywords plugin but because it does not catch french stopwords, I ought to modify the tree to remove them. Here is the code of retextStopwords:

    'use strict';
    
    const filter = require('unist-util-filter');
    
    module.exports = (retext, options) => {
      const stopwords = options.stopwords;
    
      return (node, file, next) => {
        const tree = filter(node, node => {
          return !(node.type === 'TextNode' && stopwords.indexOf(node.value) > -1);
        });
    
        file.namespace('retext').tree = tree;
    
        next(null, tree, file);
      };
    };
    

    When I check tree, it indeed does not contain the TextNodes I wanted to remove. But these words are still taken in account by retextKeywords which is next in the use() chain.

    Any tip or hint to perform this?

    Thanks a lot :-)

    🙋 no/question 
    opened by thom4parisot 4
  • Bower error: Package retext-keywords not found

    Bower error: Package retext-keywords not found

    When running bower install retext-keywords, I get the error ENOTFOUND Package retext-keywords not found. I would also appreciate some help on getting retext-keywords running on the client-side as per the demo.

    🙋 no/question 
    opened by franciskim 4
  • Update `parse-latin`, `parse-english`, `parse-dutch`

    Update `parse-latin`, `parse-english`, `parse-dutch`

    Initial checklist

    • [x] I read the support docs
    • [x] I read the contributing guide
    • [x] I agree to follow the code of conduct
    • [x] I searched issues and couldn’t find anything (or linked relevant results below)
    • [x] If applicable, I’ve added docs and tests

    Description of changes

    This updates parse-latin, parse-english, parse-dutch, to versions that include types. And clean their APIs. This is a major as it will break several plugins as of now. They will need updating.

    🧑 semver/major 🗄 area/interface ☂️ area/types 🤞 phase/open 
    opened by wooorm 1
  • Onboarding retext-language-server

    Onboarding retext-language-server

    Continuation of https://spectrum.chat/?t=16557712-7029-4718-a2bc-38453fdfb928 and https://github.com/unifiedjs/governance/issues/11 @aecepoglu is offering to contribute retext-language-server. https://github.com/unifiedjs/governance/blob/master/governance-grant.md

    I think it could be a good fit for the organization, and a good starting point for additional language servers for other unified projects. Thoughts @retextjs/core?

    🙉 open/needs-info 👩‍⚕ area/health 
    opened by ChristianMurphy 10
Releases(8.1.0)
Owner
retext
natural language processor powered by plugins part of the @unifiedjs collective
retext
Modest natural-language processing

compromise modest natural language processing npm install compromise by Spencer Kelly and many contributors isn't it weird how we can write text, but

spencer kelly 10.4k Dec 30, 2022
:robot: Natural language processing with JavaScript

classifier.js ?? An library for natural language processing with JavaScript Table of Contents Instalation Example of use Auto detection of numeric str

Nathan Firmo 90 Dec 12, 2022
the 'natural satellite' subnet manager

deimos the 'natural satellite' subnet manager more just built against a grudge, because a spreadsheet is the worst way to store this kind of informati

Aaron Duce 2 Feb 7, 2022
An NLP library for building bots, with entity extraction, sentiment analysis, automatic language identify, and so more

NLP.js If you're looking for the version 3 docs, you can find them here Version 3 "NLP.js" is a general natural language utility for nodejs. Currently

AXA 5.3k Dec 29, 2022
🤖chat discord bot powered by Deep learning algorithm🧠

✨ Akaya ✨ ❗ Discord integration functionality not implemented yet! Only the deep-learning module working. Install git clone https://github.com/LyeZinh

Pedro Kaleb! 3 Jun 23, 2022
Get warnings and error messages in monaco editor based on a unified processor.

monaco-unified Get warnings and error messages in monaco editor based on a unified processor. Installation npm install monaco-unified Usage First, cre

Remco Haszing 15 Nov 4, 2022
⚡️The Fullstack React Framework — built on Next.js

The Fullstack React Framework "Zero-API" Data Layer — Built on Next.js — Inspired by Ruby on Rails Read the Documentation “Zero-API” data layer lets y

⚡️Blitz 12.5k Jan 4, 2023
Simple, configurable part mock part proxy

Moxy Simple, configurable mock / proxy server. Table of Contents Quick start Programatic CLI Docker Docker compose Usage Programatic Via HTTP requests

Acrontum GmbH 7 Aug 12, 2022
Semantic is a UI component framework based around useful principles from natural language.

Semantic UI Semantic is a UI framework designed for theming. Key Features 50+ UI elements 3000 + CSS variables 3 Levels of variable inheritance (simil

Semantic Org 50.3k Dec 31, 2022
Semantic is a UI component framework based around useful principles from natural language.

Semantic UI Semantic is a UI framework designed for theming. Key Features 50+ UI elements 3000 + CSS variables 3 Levels of variable inheritance (simil

Semantic Org 50.3k Jan 3, 2023
general natural language facilities for node

natural "Natural" is a general natural language facility for nodejs. It offers a broad range of functionalities for natural language processing. Docum

null 10k Jan 9, 2023
Modest natural-language processing

compromise modest natural language processing npm install compromise by Spencer Kelly and many contributors isn't it weird how we can write text, but

spencer kelly 10.4k Dec 30, 2022
Semantic is a UI component framework based around useful principles from natural language.

Semantic UI Semantic is a UI framework designed for theming. Key Features 50+ UI elements 3000 + CSS variables 3 Levels of variable inheritance (simil

Semantic Org 50.3k Jan 7, 2023
Parses natural language to date schedules.

DateParrot DateParrot parses natural language into a unified schedule object or ISO date. This package is in a very early stage and not yet production

Jörg Bayreuther 7 Aug 3, 2022
:robot: Natural language processing with JavaScript

classifier.js ?? An library for natural language processing with JavaScript Table of Contents Instalation Example of use Auto detection of numeric str

Nathan Firmo 90 Dec 12, 2022
A romhack created by the Hylian Modding community as a collective project.

OotCommunityHack2022 A romhack created by the Hylian Modding community as a collective project. The structure of this repository is subject to change.

Hylian Modding 3 Aug 23, 2022
An open UI for Hydra, a protocol on Solana for facilitating collective account pooling, fan out wallet and dao treasury

An open UI for Hydra, a protocol on Solana for facilitating collective account pooling, fan out wallet and dao treasury.

Cardinal 16 Dec 20, 2022
Attempt at remaking Chatsounds processor in JavaScript.

sh A chatsound processor written in JS. Installation Run npm install github:NonagonNetwork/sh to install. Browser Preface :echo, :lfopitch and :lfovol

Litterbin Collective 7 Dec 25, 2022
Snapmaker 2.0 (A350, A250, A150) tool libraries, machine profiles, post processor...

Snapmaker 2.0 On this repository I'm adding some machine configurations, tool libraries and post-processor to use the Snapmaker 2.0 A350, A250 and A15

Nuno Oliveira 30 Jan 4, 2023