Coder Social home page Coder Social logo

bent10 / stopmarkdown Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 97 KB

Extracts plain text from Markdown strings. It's useful for Natural Language Processing (NLP) tasks.

Home Page: https://www.npmjs.com/package/stopmarkdown

License: MIT License

TypeScript 100.00%
markdown nlp plaintext strip text token tokenize

stopmarkdown's Introduction

stopmarkdown

A utility for Node.js and the browser that extracts plain text from Markdown strings. It's useful for Natural Language Processing (NLP) tasks that require only the textual content of Markdown documents.

Install

npm install stopmarkdown

Or yarn:

yarn add stopmarkdown

Alternatively, you can also include this module directly in your HTML file from CDN:

UMD: https://cdn.jsdelivr.net/npm/stopmarkdown/dist/index.umd.js
ESM: https://cdn.jsdelivr.net/npm/stopmarkdown/+esm
CJS: https://cdn.jsdelivr.net/npm/stopmarkdown/dist/index.cjs

Usage

import stopmarkdown from 'stopmarkdown'

const markdownContent = `
# Heading 1

This is a paragraph with some *italic* and **bold** text.

- Item 1
- Item 2

## Heading 2

> Blockquote

\`\`\`js
console.log('Code block');
\`\`\`
`

const segments = stopmarkdown(markdownContent)
console.log(segments)

API

stopmarkdown(input: string): string[]

Returns an array of text segments extracted from the Markdown string.

  • input: The Markdown string to tokenize.

Related

  • boox – Performing full-text search across multiple documents by combining TF-IDF score with inverted index weight.
  • stophtml – Extracts plain text from an HTML string.
  • nomark – Transforms hypertext strings (e.g., HTML, Markdown) into plain text for natural language processing (NLP) normalization.
  • stopword – Allows you to strip stopwords from an input text (supports a ton of languages).

Contributing

We 💛  issues.

When committing, please conform to the semantic-release commit standards. Please install commitizen and the adapter globally, if you have not already.

npm i -g commitizen cz-conventional-changelog

Now you can use git cz or just cz instead of git commit when committing. You can also use git-cz, which is an alias for cz.

git add . && git cz

License

GitHub

A project by Stilearning © 2024.

stopmarkdown's People

Contributors

bent10 avatar renovate[bot] avatar semantic-release-bot avatar

Stargazers

 avatar

Watchers

 avatar  avatar

stopmarkdown's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

github-actions
.github/workflows/pr-title.yml
  • actions/checkout v4
  • amannn/action-semantic-pull-request v5
.github/workflows/release.yml
  • actions/checkout v4
  • actions/setup-node v4
.github/workflows/validate.yml
  • actions/checkout v4
  • actions/setup-node v4
npm
package.json
  • stophtml ^1.0.2
  • doogu 3.2.13
  • marked 12.0.2
  • vite-plugin-resolve-umd-format 1.0.0

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.