# nlptoolkit-corpus

> Corpus Library

Latest version **1.0.12** (published 2026-02-15) · ISC license · 0 weekly downloads

## Install

```sh
npm install nlptoolkit-corpus
pnpm add nlptoolkit-corpus
yarn add nlptoolkit-corpus
bun add nlptoolkit-corpus
```

## Health

**Score 55/100 (C)** — status: stable.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 1.0.12 |
| Published | 2026-02-15 |
| First published | 2021-11-23 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 6.1 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Olcay Taner Yıldız |
| Maintainers | olcaytaner |

## Links

- npm: https://www.npmjs.com/package/nlptoolkit-corpus
- Repository: https://github.com/StarlangSoftware/Corpus-Js
- Homepage: https://github.com/StarlangSoftware/Corpus-Js#readme
- Issues: https://github.com/StarlangSoftware/Corpus-Js/issues
- npm.io page: https://npm.io/package/nlptoolkit-corpus

## Dependencies (3)

- [nlptoolkit-util](https://npm.io/package/nlptoolkit-util.md) ^1.0.12
- [nlptoolkit-dictionary](https://npm.io/package/nlptoolkit-dictionary.md) ^1.0.14
- [nlptoolkit-datastructure](https://npm.io/package/nlptoolkit-datastructure.md) ^1.0.9

## Recent versions

- 1.0.12 (latest) — 2026-02-15
- 1.0.11 — 2026-02-14
- 1.0.10 — 2025-03-07
- 1.0.9 — 2022-11-21
- 1.0.8 — 2022-09-23
- 1.0.7 — 2022-09-06
- 1.0.6 — 2022-04-28
- 1.0.5 — 2022-02-11
- 1.0.4 — 2022-01-12
- 1.0.3 — 2022-01-12
- 1.0.2 — 2021-11-28
- 1.0.1 — 2021-11-27
- 1.0.0 — 2021-11-23

## README

Corpus
============

Video Lectures
============

[<img src="https://github.com/StarlangSoftware/Corpus/blob/master/video.jpg" width="50%">](https://youtu.be/xTrdKY5uI08)

For Developers
============
You can also see [Java](https://github.com/starlangsoftware/Corpus), [Python](https://github.com/starlangsoftware/Corpus-Py), 
[Cython](https://github.com/starlangsoftware/Corpus-Cy), [Swift](https://github.com/starlangsoftware/Corpus-Swift), 
[C](https://github.com/starlangsoftware/Corpus-C), [C++](https://github.com/starlangsoftware/Corpus-CPP), or [C#](https://github.com/starlangsoftware/Corpus-CS) repository.

## Requirements

* [Node.js 14 or higher](#Node.js)
* [Git](#git)

### 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](https://nodejs.org/en/download/).

### Git

Install the [latest version of Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git).

## Npm Install

	npm install nlptoolkit-corpus
	
## 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/corpus-js.git

## Open project with Webstorm IDE

Steps for opening the cloned project:

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

Detailed Description
============

+ [Corpus](#corpus)
+ [TurkishSplitter](#turkishsplitter)

## Corpus

To store a corpus in memory

	a = Corpus("derlem.txt");

If this corpus is split with dots but not in sentences

	constructor(fileName: string = undefined, splitterOrChecker: SentenceSplitter = undefined)

To eliminate the non-Turkish sentences from the corpus

	constructor(fileName: string = undefined, splitterOrChecker: LanguageChecker = undefined)

The number of sentences in the corpus

	sentenceCount(): number

To get ith sentence in the corpus

	getSentence(index: number): Sentence

## TurkishSplitter

TurkishSplitter class is used to split the text into sentences in accordance with the . rules of Turkish.

	split(line: string): Array<Sentence>

---
_Source: https://npm.io/package/nlptoolkit-corpus · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
