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

nlptoolkit-util

v1.0.9

Published

Simple Utils Library

Downloads

22

Readme

For Developers

You can also see Cython, Java, C++, Swift, C, Python, or C# repository.

Requirements

Node.js

To check if you have a compatible version of Node.js installed, use the following command:

node -v

You can find the latest version of Node.js here.

Git

Install the latest version of Git.

Npm Install

npm install nlptoolkit-util

Download Code

In order to work on code, create a fork from GitHub page. Use Git for cloning the code to your local or below line for Ubuntu:

git clone <your-fork-git-link>

A directory called util will be created. Or you can use below link for exploring the code:

git clone https://github.com/starlangsoftware/util-js.git

Open project with Webstorm IDE

Steps for opening the cloned project:

  • Start IDE
  • Select File | Open from main menu
  • Choose Util-Js file
  • Select open as project option
  • Couple of seconds, dependencies will be downloaded.

Detailed Description

Interval

Aralık veri yapısını tutmak için Interval sınıfı

a = Interval()

1 ve 4 aralığı eklemek için

a.add(1, 4)

i. aralığın başını getirmek için (yukarıdaki örnekteki 1 gibi)

getFirst(index: number):number

i. aralığın sonunu getirmek için (yukarıdaki örnekteki 4 gibi)

getLast(index: number):number

Subset

Altküme tanımlamak ve tüm altkümelere ulaşmak için Subset ve SubsetFromList sınıfları

Subset veri yapısını tanımlamak için

Subset(rangeStart: number, rangeEnd: number, elementCount: number)

Burada elemenCount elemanlı, elemanları rangeStart ile rangeEnd arasında değerler alabilen tüm altkümeleri gezen bir yapıdan bahsediyoruz. Örneğin

Subset(1, 4, 2), bize iki elemanlı elemanlarını 1 ile 4 arasından gelen tüm alt kümeleri seçmek için kullanılan bir constructor'dır. Tüm altkümeleri elde etmek için

a = Subset(1, 4, 2);
subset = a.get()
while (a.next()){
	subset = a.get()
	....

Burada subset sırasıyla {1, 2}, {1, 3}, {1, 4}, {2, 3}, {2, 4}, {3, 4} altkümelerini gezer.

SubsetFromList

Altküme tanımlamak ve tüm altkümelere ulaşmak için Subset ve SubsetFromList sınıfları

SubsetFromList veri yapısını kullanmak için

SubsetFromList(list: Array<number>, elementCount: number)

Burada elementCount elemanlı, elemanları list dizisinden çekilen değerler olan ve tüm altkümeleri gezen bir yapıdan bahsediyoruz. Örneğin

SubsetFromList([1, 2, 3, 4], 3), bize üç elemanlı elemanlarını [1, 2, 3, 4] listesinden seçen ve tüm alt kümeleri gezmekte kullanılan bir constructor'dır. Tüm altkümeleri elde etmek için

a = SubsetFromList([1, 2, 3, 4], 3)
subset = a.get()
while (a.next()){
	subset = a.get()
	....

Burada SubsetFromList sırasıyla {1, 2, 3}, {1, 2, 4}, {1, 3, 4}, {2, 3, 4} altkümelerini gezer.

Permutation

Permütasyon tanımlamak ve tüm permütasyonlara ulaşmak için Permutation sınıfı

Permutation(n: number)

Burada 0 ile n - 1 arasındaki değerlerin tüm olası n'li permütasyonlarını gezen bir yapıdan bahsediyoruz. Örneğin

Permutation(5), bize değerleri 0 ile 4 arasında olan tüm 5'li permütasyonları gezmekte kullanılan bir constructor'dır. Tüm permütasyonları elde etmek için

a = Permutation(5)
permutation = a.get()
while (a.next()){
	permutation = a.get();
	...

Burada Permutation sırasıyla {0, 1, 2, 3, 4}, {0, 1, 2, 4, 3} gibi permütasyonları gezer.