npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@byte-this/text-process

v1.0.8

Published

A library which provides functionality for reducing and processing words and phrases.

Downloads

3

Readme

text-process

A library which provides functionality for reducing and processing words and phrases:

  • Stemmer: reduce words to a common base word, such as "running" => "run"
  • Tokenizer: reduce sentences to a list of stemmed words
  • String Distance: determine the edit distance between strings

For more info on how to use + the concepts behind the implementation, please visit: https://bytethisstore.com/articles/pg/search-text-process

Stemming

Stemming is a process which converts a word into a common base form which may or may not be a word itself. For example:

  • running => run
  • error => error
  • worrying => worri (not a real word)
  • exemplifying => exemplifi (not a real word)
  • contained => contain

Stemming can be used as a means of normalizing words to a conceptual "base form" which an algorithm can then leverage to perform some operation, such as:

  • Comparing: checking if two strings or documents contain the same words, even if there are different suffixes, such as "ing"
  • Searching: reducing words in a search query to base forms so different forms of words can return the same results
  • Quantifying: collecting logs or metrics about how often some particular word is included in a text, including variations on that word.

There is a similar process called Lemmatization which takes this a step further by considering the context in which a particular word is in, such as noun vs verb, and is able to convert the word to its correct base word which is called the Lemma. While more accurate, it is also more expensive to perform this operation.

Stop Words

Stop words are words which are highly common, such as "the", "and", "I". In certain cases these words can be filtered out of strings when performing processing, analysis, or other operations in which these words are superfluous.

Tokens and Tokenizing

The tokenizer in this library uses the Stemmer to convert a string to a list of tokens which are stemmed words with only alphanumeric characters. It filters out certain stop-words. A few examples:

  • "The quick brown fox jumps over the lazy dog" => ["quick", "brown" , "fox", "jump", "lazi", "dog"]
  • "An apple a day keeps the doctor away" => ["appl", "dai", "keep", "doctor", "awai"]
  • "While I was running I ran into the wall" => ["run", "ran", "wall"]